Fixed duplicates-removal bug