Fix bug in QueryIT