more encoding fixes