fix in Database.purgeRevisions