fixes concurrency issues and bugs in the test hardness