Handles accessing attributes in a more robust manner

Handles the (rare) case where accessing the attribute name will return nil.