More encoding fixes 2