Fixes for over escaping in c2bed0a.

Fixes dozens of tool functional tests.
Merge next-stable.