Fix timeout handling