Getting the tests to pass consistently