Fix isDefined test