Compare categories instead of category names in a few places.