Fix ignored ids for belongsToMany relations

Fix ids ignored by marshaller for belongsToMany relations.
What about composite primary keys? This change will not work with composite keys.