Fix detection of timeouts