Fix AIOOB exception in UID type/id tuple creation.

Closes #2695