Hopefully fixes small race conditions for test cases