Remove duplicates when replacing file paths