Update to new Encode() signature.