Fixed bug with http error handling.