Lots of fix up for categories.