Fix encoding/decoding formats to satisfy Octave.