Fix decode/encode mix up.