Fixed some query source aliasing issues

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