Improve comment headings
Trim whitespace when sanitizing error messages