Working on statistics queries and tests