Fix for discovering the cat_ids structure when the 'ids' are of str type.