Fix crash with 1-n relations.