Updated nil checks