Rewrote ID frobnication to do the right thing.