More encoding fixes 3