Fixed a bug with ToHttpResponseMessage not properly setting the status code if there are errors.