Fix recursive toJSON with missing relations
Merge pull request #7 from johtso/tojson-issue

Recursive toJSON breaks for missing relations