Further tweaking of timeout code.