Query tweaks for jugglingdb.