Various fixes for tests in parallel.