several utf8 related errors fixed