Fix timeout function.