Fixed bug in path duplicate removal.