Fix some UTF-8 issues in template output.