Fix error handling for remote http errors