fix type error for nested object
Merge pull request #8 from lusini/fix-type-error

Fix type error for nested object (closes #7)