Fix logic of logging errors to corrections.json.