Fix a bug that can lead to noDuplicate# not working sometimes.