anchor.diff:      F = fun(Key, Value) -> parse_field(Key, Value, Types) end,
   
       ?assertMatch(
  -       {error, {unknown_field_type, <<"unknowntype">>}}, 
  -       F(<<"unknowntype">>, <<"A">>)).
  -
  -validate_object_test() ->
  +       {error, {unknown_field_type, <<"unknowntype">>}},
  +       F(<<"unknowntype">>, <<"A">>)),
  +
  +    ?assertMatch(
  +       {error, {unknown_field_type, <<"test_$bucket">>}},
  +       F(<<"test_$bucket">>, <<"A">>)),
  +
  +    ?assertMatch(
  +       {error, {unknown_field_type, <<"test_$key">>}},
  +       F(<<"test_$key">>, <<"A">>)),
  +
  +    ?assertMatch(
  +       {error, {unknown_field_type, <<"_int">>}},
  +       F(<<"_int">>, <<"A">>)),
  +
  +    ?assertMatch(
  +       {error, {unknown_field_type, <<"_bin">>}},
  +       F(<<"_bin">>, <<"A">>)).
  +
  +
  +parse_object_hook_test() ->
       %% Helper function to create an object using a proplist of
  -    %% supplied data, and call validate_object on it.
  +    %% supplied data, and call parse_object_hook on it.
       F = fun(MetaDataList) ->
                   Obj = riak_object:new(<<"B">>, <<"K">>, <<"VAL">>, dict:from_list([{?MD_INDEX, MetaDataList}])),
                   parse_object_hook(Obj)
  
positive.code: %%
  %% @doc Return a list of {MatchFunction, ParseFunction} tuples that
  %%      map a field name to a field type.
  field_types() -> 
      %% Return a function that takes one argument, a Field Name, and
      %% returns true if the Field Name matches the provided
      %% suffix. 
      F = fun(Suffix) ->
                  %% Return a function.
                  fun(Field) ->
                          %% Calculate the offset where the suffix should start.
                          Offset = size(Field) - size(Suffix),
                          case Offset >= 0 of
                              true -> 
                                  %% Pattern match on the Suffix.
                                  case Field of
                                      <<_:Offset/binary, Suffix/binary>> -> true;
                                      _ -> false
                                  end;
                              false ->
                                  false
                          end
                  end
          end,
      [
       {F(<<"$bucket">>), fun parse_binary/1},
       {F(<<"$key">>),    fun parse_binary/1},
       {F(<<"_bin">>),    fun parse_binary/1},
       {F(<<"_int">>),    fun parse_integer/1}
      ].
  
  
  
negative.code:     F = fun({Field, Value}, {ResultAcc, ErrorAcc}) ->
                  Field1 = normalize_index_field(Field),
                  case parse_field(Field1, Value, Types) of
                      {ok, ParsedValue} ->
                          NewResultAcc = [{Field1, ParsedValue} | ResultAcc],
                          {NewResultAcc, ErrorAcc};
                      {error, Reason} ->
                          NewErrorAcc = [Reason | ErrorAcc],
                          {ResultAcc, NewErrorAcc}
                  end
  