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 Encodes a map operation into a MapOp message.
  -spec encode_map_op(map_op()) -> #mapop{}.
  encode_map_op({update, Adds, Removes, Updates}) ->
      #mapop{
         adds=[ encode_map_field(A) || Adds /= undefined, A <- Adds ],
         removes=[ encode_map_field(R) || Removes /= undefined, R <- Removes ],
         updates=[ encode_map_update(K,O) || Updates /= undefined,
                                             {K, O} <- Updates ]}.
  
  decode_map_op(#mapop{adds=Adds, removes=Removes, updates=Updates}, Mods) ->
      {update, 
       [ decode_map_field(A, Mods) || A <- Adds ],
       [ decode_map_field(R, Mods) || R <- Removes ],
       [ decode_map_update(U, Mods) || U <- Updates ]}.
  
  %% @doc Decodes a DtOperation message into a datatype-specific operation.
  -spec decode_operation(#dtop{}) -> toplevel_op().
  
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().
  
  