Ignore empty identities when checking for duplicates.