Improvements to sorting in the user flag table.