made query table slightly less yucky, as per issue #86