Fixed incomplete implementation of finding a query caller.