Fixed sporadic unit test failures