Add a few tests for encode/decode