Remove duplicate patterns