Fix a problem returning error responses