Bug fixes to URL and TeX escaping.

Change-Id: I413c259a655eb56000ddb5b50c31258c9b95c610