anchor.diff:  						false
   			end,
   			NewFilters = lists:dropwhile(F2, Filters),
  -			filter2(NewFilters, L1, NewAcc);
  +			filter3(NewFilters, L1, NewAcc);
   		_ ->
   			throw({error, 400})
   	end;
  -filter2([{[], []} | T], L, Acc) ->
  -	filter2(T, L, Acc);
  -filter2([], _, Acc) ->
  -	lists:reverse(Acc).
  -%% @hidden
  -filter3(struct, Filters, L1) ->
  -	{struct, filter2(Filters, L1, [])};
  -filter3(array, Filters, L1) ->
  -	{array, filter4(Filters, L1, [])}.
  +filter3([{[], []} | T], L, Acc) ->
  +	filter3(T, L, Acc);
  +filter3([], _, Acc) ->
  +	lists:reverse(Acc).
   %% @hidden
   filter4(Filters, [{struct, L1} | T], Acc) ->
   	NewAcc = case filter5(Filters, L1, []) of
  
positive.code: 
  %% @hidden
  %% put filters in order so we can process (once) sequentially
  filter1([Filter | T], L, []) ->
  	[Name | RevPath] = lists:reverse(Filter),
  	filter1(T, L, [{[Name], RevPath}]);
  filter1([Filter | T1], L, [{Names, RevPath} | T2] = Acc) ->
  	case lists:reverse(Filter) of
  		[Name | RevPath] ->
  			filter1(T1, L, [{[Name | Names], RevPath} | T2]);
  		[Name | NewRevPath] ->
  			filter1(T1, L, [{[Name], NewRevPath} | Acc])
  	end;
  filter1([], L, Acc) ->
  	Filters = [{lists:reverse(Path), lists:reverse(Names)}
  			|| {Names, Path} <- lists:reverse(Acc)],
  	lists:reverse(filter2(Filters, L, [])).
  %% @hidden
  %% filter fields from object
  filter2([{[], [H | T1]} | T2] = _Filters, L, Acc) ->
  	case lists:keyfind(H, 1, L) of
  		false ->
  			filter2([{[], T1} | T2], L, Acc);
  		KV ->
  			filter2([{[], T1} | T2], L, [KV | Acc])
  	end;
  %% depth first traversal for complex filters
  filter2([{[H | _], _} | T] = Filters, L1, Acc) ->
  	case lists:keyfind(H, 1, L1) of
  		false ->
  			filter2(T, L1, Acc);
  		{H, {Type, L2}} when Type == struct; Type == array ->
  			% remove parent from filter path
  			F1 = fun({[Prefix | Suffix], Names}) when Prefix == H ->
  						{true, {Suffix, Names}};
  
negative.code: %%
  %% @throws {error, 400}
  %%
  filter(Filters, JsonObject) when is_list(Filters) ->
  	Filters1 = case lists:member($(, Filters) of
  		true ->
  			expand(Filters, []);
  