Improved behavior support, fixes #2550

call hasMethod() instead of using method_exists