Fix reliance on old Id allocation.

We were relying on the fact that if the kinds of two identifiers were
different, then the names would be different. That's no longer the case.