Correct some mistakes in the dealing with multibyte characters.