Escape more bad syntax

This should stop many of the "invalid syntax" exceptions we see.

Change-Id: I9952f2ecfe6e9c9d770f50df4266d688c535269e
Merge "Escape more bad syntax"