Fixed variable typo in TQuery

Signed-off-by: Tom Wright <tom@inflatablecookie.com>