anchor.diff:                          dict:fetch(any, Dict);
                       _ ->
                           gb_sets:union(
  -                          [element(2,Y) || X <- ZoneIds,
  -                                           Y <- dict:find(X, Dict),
  -                                           Y /= error])
  +                          [element(2, Y)
  +                           || Y <- [dict:find(X, Dict) || X <- ZoneIds],
  +                              Y /= error])
                   end
           end,
       DocIds =
           fun ({Keyword, ZoneIds}) ->
  -                io:format("Keyword = ~p~n", [Keyword]),
  -                io:format("ZoneIds = ~p~n", [ZoneIds]),
                   case dict:fetch(Keyword, Terms) of
                       stop_word -> gb_sets:empty();
  -                    Term -> DocIdsForZoneIds(ZoneIds, dict:fetch(Term, Data))
  +                    [Term] ->
  +                        Dict = dict:fetch(Term, Data),
  +                        DocIdsForZoneIds(ZoneIds, Dict)
                   end
           end,
       Calculate = fun ({Keywords,NotKeywords}) ->
  
positive.code:                        case Q of
                             #not_q{sub_q = S} ->
                                 {S#term_q.keyword,S#term_q.zone_ids};
                             _ ->
                                 {Q#term_q.keyword,Q#term_q.zone_ids}
                         end
                 end,
      {lists:usort([Destruct(Q)||Q <- TermQs]),
  
negative.code: -module(doko_query).
  -ifdef(TEST).
  -include_lib("proper/include/proper.hrl").
  -include_lib("eunit/include/eunit.hrl").
  -endif.
  