statistics: Bugfix for query.