Tweaks to JSON parsing