Add counter support to the String() method of Query