fix for issue #7 - toJSON on nested array