Fix hasmany set custom primary keys