Add encoding test coverage.
Add partial omitempty.