Define num_queries in the proper place.