Fixed all the race conditions. Now we pass all the tests.