bug fixes in rarer errors and utf-8 printing