Handle HTTP errors better, fix PR