In two functions the variable " $this->ch " isn't correctly set. Line 2279 and in the elseif block line 3176 to 3200, see pictures below.  