Fix failing tests

Ensure the object isn't nil before referencing a property