More hacking work on query lang