Improve the countqueries command.