Fix error response handling.