anchor.diff:      case lists:keyfind(type, 1, Is) of
   	false ->
   	    undefined;
  +	{type, L, <<"union">>, Ts} ->
  +	    {type, L, <<"union">>, [type([T1], Data, Imports) ||
  +				       {type,_,_,_} = T1 <- Ts]};
   	{type, _, T, _} = Type ->
   	    case binary:split(T, <<":">>) of
   		[Pfx, Ts] ->
   		    ImpData = orddict:fetch(Pfx, Imports),
   		    case [D1 || {typedef,_,T1,D1} <- ImpData, Ts == T1] of
  -			[Def] ->
  +			[_] = Def ->
   			    type(Def, ImpData, Imports);
   			[] ->
   			    Type
  
positive.code:     Dir = filename:dirname(YangFile),
      case read(YangFile, Ext = filename:extension(YangFile), Opts) of
  	{{ok, Y}, Ext} ->
  	    each_module(fun to_json_rpc/3, Y, {Dir, Ext, Opts});
  	{Error, _} ->
  	    Error
      end.
  
  read(F) ->
      read(F, filename:extension(F), []).
  
negative.code: rpc_params([{anyxml,_,N,Is}|T], Data, Imports) ->
      [{binary_to_list(N), "", descr(Is), anyxml}
       | rpc_params(T, Data, Imports)];
  rpc_params([{leaf_list,_,N,Items}|T], Data, Is) ->
      L = binary_to_list(N),
      [{L, {array, [{L, "", descr(Items), type(Items, Data, Is)}]},
        descr(Items), type(Items, Data, Is)}
       | rpc_params(T, Data, Is)];
  rpc_params([{list,_,N,Items}|T], Data, Is) ->
      [{binary_to_list(N), {array, [{struct, rpc_params(Items, Data, Is)}]},
        descr(Items), type(Items, Data, Is)}
       | rpc_params(T, Data, Is)];
  rpc_params([{container,_,N,Items}|T], Data, Is) ->
      [{binary_to_list(N), {struct, rpc_params(Items, Data, Is)},
        descr(Items), type(Items, Data, Is)}
       | rpc_params(T, Data, Is)];
  rpc_params([_|T], Data, Is) ->
      rpc_params(T, Data, Is);
  rpc_params([], _, _) ->
      [].
  
  log_meta(Params, Info) ->
      [{'$meta', Info}|Params].
  
  markdown(File, JSON) ->
      case file:open(File, [write]) of
  