Fix HasMany/HasOne.new and add tests