Fix a problem with timeouts not working properly.