UnicodeDecodeError fixes