Tidy up type-checking of method invocations.

The indentation was getting out of hand, so switch it around to
a series of if { } else if {} ... instead.