Make timeout handlers a bit safer.