Encode fix