Fixed case-splitting

On case-splitting "x" in "test_x x = ..." it was replacing both occurences
of "x" (including that one in "test_x").

Most likely this fix does not cover all the possible cases and it should be
fixed further.
One more case-splitting fix
Merge pull request #1278 from defanor/master

Fixed case-splitting