Updated RemoveWrongEntries method