Corrected models involved in many to many relationships