Handle nested objects (fixes #20)