Correction to error handling for empty JSON object.