Improve formatting of errors, and fix a typo