Fix issue with object inlining and relations in json

Fixes #60