Fix timeout detection