Improve contexts for error reporting, and fix unicode bug.