Added support for tuple queries