Fixes #3863: correct ordering in groups and categories display