Fixed category count to be called only when count is turned on

FAO @jamesallsup