Fixed bug in tests for withtimeout