Fixed timed out test, avoid inf loop.