Small code review tweaks to query rewrite.