Fix an issue with uid sorting