fixed a bug where the program does not sweep latest-version-consistent keys correctly