Fixed some bugs with string encoding.