More query fixes.