Tried fixing concurrency issues in testing.

Not 100% sure if it's the framework or my code, although I'm tempted to assume the latter.