[NH] Add argument preconditions to encode function.
[CS] 0.1.3-SNAPSHOT