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.