Fix categories to return a sorted list and include all directories.