Fixed bug in remove_versions