clean up checkDuplicateIdentifiers, and catch the first duplicate (rather than the alphabetically first one)