Added setter functions. Minor changes to encode/decode.