Fixed a bug with the timeout.