Small improvements to cypher query handling internals.  No change to API or behavior.