More encoding fixes 4