Fix accessing of nil objects