anchor.diff:  encode_update_response(set, Value, Key, Context, _Mods) ->
       #dtupdateresp{key=Key, context=Context, set_value=Value};
   encode_update_response(map, Value, Key, Context, Mods) when is_list(Value) ->
  -    #dtupdateresp{key=Key, context=Context, 
  -                  map_value=[ encode_map_entry(Entry, Mods) || Value /= undefined, 
  +    #dtupdateresp{key=Key, context=Context,
  +                  map_value=[ encode_map_entry(Entry, Mods) || Value /= undefined,
                                                                  Entry <- Value ]}.
  
positive.code: 
  %% @doc Decodes a SetOp message into a set operation.
  -spec decode_set_op(#setop{}) -> set_op().
  decode_set_op(#setop{adds=A, removes=R}) ->
      {update, A, R}.
  
  %% @doc Encodes a set operation into a SetOp message.
  -spec encode_set_op(set_op()) -> #setop{}.
  encode_set_op({Op, Member}) when is_binary(Member) ->
      encode_set_op({Op, [Member]});
  encode_set_op({add, Members}) when is_list(Members) ->
      #setop{adds=Members};
  encode_set_op({remove, Members}) when is_list(Members) ->
      #setop{removes=Members};
  encode_set_op({update, Adds, Removes}) when is_list(Adds), is_list(Removes) ->
      #setop{adds=Adds, removes=Removes}.
  
  %% @doc Decodes a operation name from a PB message into an atom.
  -spec decode_flag_op(atom()) -> atom().
  
negative.code: 
  %% Operations
  -type counter_op() :: increment | decrement | {increment | decrement, integer()}.
  -type simple_set_op() :: {add, binary()} | {remove, binary()} | {add_all, [binary()]} | {remove_all, [binary()]}.
  -type set_op() :: simple_set_op() | {update, [simple_set_op()]}.
  -type flag_op() :: enable | disable.
  -type register_op() :: {assign, binary()}.
  -type simple_map_op() :: {add, map_field()} | {remove, map_field()} | {update, map_field(), [embedded_type_op()]}.
  -type map_op() :: simple_map_op() | {update, [simple_map_op()]}.
  -type embedded_type_op() :: counter_op() | set_op() | register_op() | flag_op().
  -type toplevel_op() :: counter_op() | set_op() | map_op().
  
  