Fix encoding (breaks for some configurations)