Fix typo + use hasattr instead of getattr (OMS-577)