anchor.diff:  check_type(X, {type,_,<<"uint", _/binary>> = T,_}) when is_integer(X) ->
       check_uint_type(X, T);
   check_type(X, {type,_,<<"uint", _/binary>> = T,_}) ->
  -    try check_uint_type(list_to_integer(binary_to_list(X)), T)
  +    try check_uint_type(list_to_integer(to_list(X)), T)
       catch
   	error:_ ->
   	    false
       end;
  -check_type(_, _) ->
  +check_type(X, _) ->
       %% TODO: cover all types
  -    true.
  +    {true, X}.
   
   check_int_type(N, T) when is_integer(N) ->
  -    if 	T == <<"uint8">>, 08 =< N, N =< 255 -> true;
  -	T == <<"uint16">>, 0 =< N, N =< 65535 -> true;
  -	T == <<"uint32">>, 0 =< N, N =< 4294967295 -> true;
  -	T == <<"uint64">>, 0 =< N, N =< 18446744073709551615 -> true;
  +    if 	T == <<"uint8">>, 08 =< N, N =< 255 -> {true, N};
  +	T == <<"uint16">>, 0 =< N, N =< 65535 -> {true, N};
  +	T == <<"uint32">>, 0 =< N, N =< 4294967295 -> {true, N};
  +	T == <<"uint64">>, 0 =< N, N =< 18446744073709551615 -> {true, N};
   	true -> false
       end.
   
   check_uint_type(N, T) when is_integer(N) ->
  -    if T == <<"uint8">>, 08 =< N, N =< 255 -> true;
  -       T == <<"uint16">>, 0 =< N, N =< 65535 -> true;
  -       T == <<"uint32">>, 0 =< N, N =< 4294967295 -> true;
  -       T == <<"uint64">>, 0 =< N, N =< 18446744073709551615 -> true;
  +    if T == <<"uint8">>, 08 =< N, N =< 255 -> {true, N};
  +       T == <<"uint16">>, 0 =< N, N =< 65535 -> {true, N};
  +       T == <<"uint32">>, 0 =< N, N =< 4294967295 -> {true, N};
  +       T == <<"uint64">>, 0 =< N, N =< 18446744073709551615 -> {true, N};
          true -> false
       end.
  +
  +to_list(B) when is_binary(B) ->
  +    binary_to_list(B);
  +to_list(L) when is_list(L) ->
  +    L.
   
   
   get_value(I) ->
  
positive.code: %% this function for such objects (except perhaps for "untyped", which indicates that no
  %% YANG type could be found).
  %% @end
  check_type(_X, <<"object">> ) -> true;
  check_type(_X, <<"array">>  ) -> true;
  check_type(_X, <<"untyped">>) -> true;
  check_type(X, {type,_,<<"enumeration">>,En}) ->
      lists:any(fun({enum_,_,I}) ->
  		      X == get_value(I)
  	      end, En);
  check_type(X, {type,_,<<"binary">>,_}) when is_binary(X) -> true;
  check_type(X, {type,_,<<"bits">>,_}) when is_bitstring(X) -> true;
  check_type(X, {type,_,<<"boolean">>,_}) -> X == <<"1">> orelse X == <<"0">>;
  check_type(X, {type,_,<<"empty">>,_} ) -> is_empty(X);
  check_type(X, {type,_,<<"decimal64">>,_}) ->
      case re:split(X, "\\.", [{return,list}]) of
  	[Ib, Fb]  ->
  	    %% For now, we ignore fraction-digits and range checking, but at least
  	    %% verify that it's a decimal number
  	    try   _ = list_to_integer(Ib),
  		  _ = list_to_integer(Fb),
  		     %% TODO: range checking
  		 true
  	    catch
  		error:_ ->
  		    false
  	    end;
  	_ ->
  
negative.code: json_rpc(YangFile) ->
      yang_json:json_rpc(YangFile).
  
  -spec check_type(any(), type()) -> {true, any()} | false.
  %% @spec check_type(Value, Type) -> {true, ConvertedValue} | false
  %% Check Value against a YANG type definition.
  %%
  %% The "types" object, array and untyped are not actually YANG types, but used in the
  