Fixed issue with timeouts, and added tests from them.