Fix bug in timeout code.