Fix issues with json arrays

This will fix #19.