anchor.diff:  gen_internal_funcs(_,[]) ->
       ok;
   gen_internal_funcs(Erules,[TypeDef|Rest]) ->
  -    gen_encode_user(Erules,TypeDef),
  -    emit([nl,nl,"'dec_",TypeDef#typedef.name,
  -%	  "'(Tlv, OptOrMand, TagIn) ->",nl]),
  -	  "'(Tlv, TagIn) ->",nl]),
  +    gen_encode_user(Erules, TypeDef, false),
  +    emit([nl,nl,
  +	  "'dec_",TypeDef#typedef.name,"'(Tlv, TagIn) ->",nl]),
       gen_decode_user(Erules,TypeDef),
       gen_internal_funcs(Erules,Rest).
   
  
positive.code: gen_encode_constr_type(Erules,[TypeDef|Rest]) when is_record(TypeDef,typedef) ->
      case is_already_generated(enc,TypeDef#typedef.name) of
  	true -> ok;
  	_ -> gen_encode_user(Erules,TypeDef)
      end,
      gen_encode_constr_type(Erules,Rest);
  gen_encode_constr_type(_,[]) ->
  
negative.code:     NewType = Type#type{tag=[]},
      gen_encode(Erules,NewTname,NewType).
  
  gen_encode_user(Erules, #typedef{}=D, Wrapper) ->
      Typename = [D#typedef.name],
      Type = D#typedef.typespec,
      InnerType = asn1ct_gen:get_inner(Type#type.def),
      emit([nl,nl,"%%================================"]),
      emit([nl,"%%  ",Typename]),
      emit([nl,"%%================================",nl]),
      FuncName = "'enc_" ++ asn1ct_gen:list2name(Typename) ++ "'",
      case Wrapper of
  	true ->
  	    %% This is a top-level type. Generate an 'enc_Type'/1
  	    %% wrapper.
  	    OTag = Type#type.tag,
  	    Tag0 = [encode_tag_val(decode_class(Class), Form, Number) ||
  		       #tag{class=Class,form=Form,number=Number} <- OTag],
  	    Tag = lists:reverse(Tag0),
  	    emit([FuncName,"(Val) ->",nl,
  		  "    ",FuncName,"(Val, ",{asis,Tag},").",nl,nl]);
  	false ->
  	    ok
      end,
      emit([FuncName,"(Val, TagIn) ->",nl]),
      CurrentMod = get(currmod),
      case asn1ct_gen:type(InnerType) of
  	{constructed,bif} ->
  