Fixed saving one-to-many and many-to-many relations