Fix method recursion bug.

Additional checks for method call transformations.

Note: I'm not 100% certain that this patch does not actually introduce unwanted secondary effects, though tests seem to work.