Fix bug in logging of failed requests