Query fixes.