Fix queries for fetching category statistics
Use fetchColumn for getting category statistics