Update entities for correct many to many relationships