Fixing blatent missuse of parameter to hasattr.