Added non-nil checks