Update and fix associations between the three models.