Fix bug where nested condition generated wrong query.
Merge branch 'master' into uq