'r', undefined variable fixed

In line 1406 the 'r' should be 'ch1'.
Merge pull request #52 from Midnith/patch-1

Undefined variable 'r' fixed