Fix rule-based sorting.

Ensure all IDs are converted to the correct namespaced form for vanilla short-form IDs.