Extend test coverage for UpdateEncoder.
Fix problems found in UpdateEncoder.