Fix blowing up on invalid JSON when parsing