anchor.diff:  del_(Obj, <<"-">>) when is_list(Obj) ->
       {ok, lists:droplast(Obj)};
   
  -del_(Obj, Field) when is_list(Obj) andalso is_integer(Field) ->
  +del_(Obj, Field) when is_list(Obj) andalso is_integer(Field)
  +                      andalso length(Obj) >= Field andalso Field >= 0->
       Result = case lists:split(Field, Obj) of
                    {[], [_|T]} -> T;
                    {H1, [_|T]} -> H1 ++ T;
  
positive.code:     end.
  
  % this will only match if you try to replace the whole document with an empty path
  replace(_Obj, [], Val) ->
      {ok, Val};
  replace(Obj, [Field], Val) ->
      case get_(Obj, Field) of
          {ok, _FieldObj} ->
  
negative.code:         Other -> Other
      end.
  
  % calling remove with an empty path (i.e the documents root) removes all
  % elements. This is equivalent to a new, empty object
  remove(Obj, []) ->
      {ok, dict:new()};
  
  remove(Obj, [Field]) ->
      case get_(Obj, Field) of
          {ok, _FieldObj} ->
  