Fix counts for queries