Issue #2863366 by Keenegan: Changed count queries to use the faster COUNT(*) expression rather than countQuery().