Undefined variable 'r' fixed

In line 1406 the 'r' should be 'ch1'.