Encoding fixes applied