Bit of fix up for category query building.