Fixed debugger for queries