Fixed crashes due to UTF-8 characters.