anchor.diff:              Group, IndexHeader) ->
        #index_header{seq=Seq, purge_seq=PurgeSeq,
               id_btree_state=IdBtreeState, view_states=ViewStates} = IndexHeader,
  +    StateUpdate = fun
  +        ({_, _, _}=State) -> State;
  +        (State) -> {State, 0, 0}
  +    end,
  +    ViewStates2 = lists:map(StateUpdate, ViewStates),
       {ok, IdBtree} = couch_btree:open(IdBtreeState, Fd),
       Views2 = lists:zipwith(
           fun({BTState, USeq, PSeq}, #view{reduce_funs=RedFuns,options=Options}=View) ->
  
positive.code:             lib={[]},
              def_lang=Language,
              design_options=DesignOptions}=G) ->
      ViewInfo = [V#view{update_seq=0, purge_seq=0} || V <- Views],
      G#group{sig=couch_util:md5(term_to_binary({ViewInfo, Language, DesignOptions}))};
  set_view_sig(#group{
              views=Views,
              lib=Lib,
              def_lang=Language,
              design_options=DesignOptions}=G) ->
      ViewInfo = [V#view{update_seq=0, purge_seq=0} || V <- Views],
      G#group{sig=couch_util:md5(term_to_binary({ViewInfo, Language, DesignOptions, sort_lib(Lib)}))}.
  
  sort_lib({Lib}) ->
      sort_lib(Lib, []).
  
negative.code:             ),
              View#view{btree=Btree, update_seq=USeq, purge_seq=PSeq}
          end,
          ViewStates2, Views),
      Group#group{db=Db, fd=Fd, current_seq=Seq, purge_seq=PurgeSeq,
          id_btree=IdBtree, views=Views2}.
  
  