Fixed bug in hasOne