Fix checking when referring to a method