Fix incorrect check for existence of an instance method