Fix match duplication bug