Merging "optional remove duplicate" feature.