Be defensive with JSON parsing