Fix encoding/decode speed.