Some more encoding fixes