anchor.diff:        end},
        {"decode map ops",
         fun() ->
  +              ModMap = riak_kv_crdt:mod_map(map),
                 %% Simple ops
  -              ?assertEqual({map, {update, [{add, {<<"a">>, ?COUNTER_TYPE}}]}, undefined},
  -                           update_request_from_json(map, {struct, [{<<"add">>, <<"a_counter">>}]}, ?MOD_MAP)),
  -              ?assertEqual({map, {update, [{add, {<<"a">>, ?COUNTER_TYPE}}, {add, {<<"a">>, ?SET_TYPE}}]}, undefined},
  -                           update_request_from_json(map, {struct, [{<<"add">>, [<<"a_counter">>, <<"a_set">>]}]}, ?MOD_MAP)),
  -              ?assertEqual({map, {update, [{remove, {<<"a">>, ?COUNTER_TYPE}}]}, undefined},
  -                           update_request_from_json(map, {struct, [{<<"remove">>, <<"a_counter">>}]}, ?MOD_MAP)),
  -              ?assertEqual({map, {update, [{remove, {<<"a">>, ?COUNTER_TYPE}}, {remove, {<<"a">>, ?SET_TYPE}}]}, undefined},
  -                           update_request_from_json(map, {struct, [{<<"remove">>, [<<"a_counter">>, <<"a_set">>]}]}, ?MOD_MAP)),
  +              ?assertEqual({map, {update, [{add, {<<"a">>, ?EMCNTR_TYPE}}]}, undefined},
  +                           update_request_from_json(map, {struct, [{<<"add">>, <<"a_counter">>}]}, ModMap)),
  +              ?assertEqual({map, {update, [{add, {<<"a">>, ?EMCNTR_TYPE}}, {add, {<<"a">>, ?SET_TYPE}}]}, undefined},
  +                           update_request_from_json(map, {struct, [{<<"add">>, [<<"a_counter">>, <<"a_set">>]}]}, ModMap)),
  +              ?assertEqual({map, {update, [{remove, {<<"a">>, ?EMCNTR_TYPE}}]}, undefined},
  +                           update_request_from_json(map, {struct, [{<<"remove">>, <<"a_counter">>}]}, ModMap)),
  +              ?assertEqual({map, {update, [{remove, {<<"a">>, ?EMCNTR_TYPE}}, {remove, {<<"a">>, ?SET_TYPE}}]}, undefined},
  +                           update_request_from_json(map, {struct, [{<<"remove">>, [<<"a_counter">>, <<"a_set">>]}]}, ModMap)),
                 %% Removes get ordered before adds, multiple ops extracted
  -              ?assertEqual({map, {update, [{remove, {<<"a">>, ?COUNTER_TYPE}}, {add, {<<"a">>, ?SET_TYPE}}]}, undefined},
  -                           update_request_from_json(map, {struct, [{<<"add">>, [<<"a_set">>]}, {<<"remove">>, [<<"a_counter">>]}]}, ?MOD_MAP)),
  +              ?assertEqual({map, {update, [{remove, {<<"a">>, ?EMCNTR_TYPE}}, {add, {<<"a">>, ?SET_TYPE}}]}, undefined},
  +                           update_request_from_json(map, {struct, [{<<"add">>, [<<"a_set">>]}, {<<"remove">>, [<<"a_counter">>]}]}, ModMap)),
                 %% Nested updates
  -              ?assertEqual({map, {update, [{update, {<<"a">>, ?COUNTER_TYPE}, increment}]}, undefined},
  -                           update_request_from_json(map, {struct, [{<<"update">>, {struct, [{<<"a_counter">>, <<"increment">>}]}}]}, ?MOD_MAP)),
  +              ?assertEqual({map, {update, [{update, {<<"a">>, ?EMCNTR_TYPE}, increment}]}, undefined},
  +                           update_request_from_json(map, {struct, [{<<"update">>, {struct, [{<<"a_counter">>, <<"increment">>}]}}]}, ModMap)),
   
                 ?assertEqual({map, {update, [{update, {<<"b">>, ?MAP_TYPE}, 
                                               {update, [{update, {<<"c">>, ?REG_TYPE}, {assign, <<"foo">>}}]}}]}, undefined},
  
positive.code:                                         {<<"b_flag">>, true},
                                          {<<"a_set">>, [<<"a">>, <<"b">>, <<"c">>]}]}}
                                       ]},
                             fetch_response_to_json(map, ?MAP_TYPE:value(Map), undefined, ?MOD_MAP)
                             ),
                ?assertMatch({struct, [_Type, _Value, {<<"context">>, Bin}]} when is_binary(Bin),
                             fetch_response_to_json(map, ?MAP_TYPE:value(Map),
                                                    ?MAP_TYPE:to_binary(?MAP_TYPE:precondition_context(Map)),
                                                    ?MOD_MAP))
        end}
      ].
  
  
negative.code:                                                                     {struct, [{<<"b_map">>, 
                                                                                 {struct, [{<<"update">>, 
                                                                                            {struct, [{<<"c_register">>, <<"foo">>}]}}]}}]}}]}, 
                                                      ModMap)),
                ?assertEqual({map, {update, [{update, {<<"b">>, ?MAP_TYPE}, 
                                              {update, [{update, {<<"c">>, ?FLAG_TYPE}, enable}]}}]}, undefined},
                             update_request_from_json(map, {struct, [{<<"update">>, 
                                                                      {struct, [{<<"b_map">>, 
                                                                                 {struct, [{<<"update">>, 
                                                                                            {struct, [{<<"c_flag">>, <<"enable">>}]}}]}}]}}]}, 
                                                      ModMap)),
  
                %% Extract context
                {ok, Map} = ?MAP_TYPE:update({update,
  