Fixed runnign tests simultaneousty with multiple threads.