more tests, fixed race conditions