Fix bug having to do with nil fields in a one-to-many relationship.
Merge branch 'hotfix-0.5.1'