Ensure errors in json parsing doesn't leave everything in a broken state