More query improvements.