Fixing test that would fail periodically