Fix broken logic in excludeFromUniqueChecks.