Finally resolved most of the encoding issues