Corrected bug preventing related entities to be saved