Fix issues of encoding.