Fix some utf-8 bugs