Correction of wait routine.