Slightly improved handling of failed requests and timeouts.