anchor.diff:  compile_impl([], _, Result, _) ->
       Result;
   compile_impl([{n, Key} | T], Map, Result, Options) ->
  -    compile_impl(T, Map, [escape(to_binary(data_get(binary_to_list(Key), Map, <<>>, Options))) | Result], Options);
  +    compile_impl(T, Map, [escape(to_binary(data_get(convert_keytype(Key, Options), Map, <<>>))) | Result], Options);
   compile_impl([{'&', Key} | T], Map, Result, Options) ->
  -    compile_impl(T, Map, [to_binary(data_get(binary_to_list(Key), Map, <<>>, Options)) | Result], Options);
  +    compile_impl(T, Map, [to_binary(data_get(convert_keytype(Key, Options), Map, <<>>)) | Result], Options);
   compile_impl([{'#', Key, Tags, Source} | T], Map, Result, Options) ->
  -    Value = data_get(binary_to_list(Key), Map, undefined, Options),
  +    Value = data_get(convert_keytype(Key, Options), Map, undefined),
       case check_data_type(Value) of
           true                                        -> compile_impl(T, Map, compile_impl(Tags, Value, Result, Options), Options);
           _ when is_list(Value)                       -> compile_impl(T, Map, lists:foldl(fun(X, Acc) -> compile_impl(Tags, X, Acc, Options) end,
                                                                                           Result, Value), Options);
           _ when Value =:= false; Value =:= undefined -> compile_impl(T, Map, Result, Options);
  -        _ when is_function(Value, 2)                -> compile_impl(T, Map, [Value(Source, fun(Text) -> render(Text, Map) end) | Result], Options);
  +        _ when is_function(Value, 2)                -> compile_impl(T, Map, [Value(Source, fun(Text) -> render(Text, Map, Options) end) | Result], Options);
           _                                           -> compile_impl(T, Map, compile_impl(Tags, Map, Result, Options), Options)
       end;
   compile_impl([{'^', Key, Tags} | T], Map, Result, Options) ->
  -    Value = data_get(binary_to_list(Key), Map, undefined, Options),
  +    Value = data_get(convert_keytype(Key, Options), Map, undefined),
       case Value =:= undefined orelse Value =:= [] orelse Value =:= false of
           true  -> compile_impl(T, Map, compile_impl(Tags, Map, Result, Options), Options);
           false -> compile_impl(T, Map, Result, Options)
  
positive.code:         _         -> error(?FILE_ERROR, [Filename])
      end.
  
  %% @doc Embed the data in the template.
  -spec compile(template(), data()) -> binary().
  compile(T, Data) ->
      compile(T, Data, []).
  
  %% @doc Embed the data in the template.
  -spec compile(template(), data(), options()) -> binary().
  
negative.code: escape_char($') -> <<"&apos;">>;
  escape_char(C)  -> <<C:8>>.
  
  %% @doc convert to {@link data_key/0} from binary.
  -spec convert_keytype(binary(), options()) -> data_key().
  convert_keytype(KeyBin, Options) ->
      case proplists:get_value(key_type, Options, string) of
          atom   -> list_to_atom(binary_to_list(KeyBin));
          string -> binary_to_list(KeyBin);
          binary -> KeyBin
      end.
  
  %% @doc fetch the value of the specified key from {@link data/0}
  -spec data_get(data_key(), data(), Default :: term()) -> term().
  -ifdef(namespaced_types).
  data_get(Key, Map, Default) when is_map(Map) ->
      maps:get(Key, Map, Default);
  data_get(Key, AssocList, Default) ->
      proplists:get_value(Key, AssocList, Default).
  -else.
  data_get(Key, AssocList, Default) ->
      proplists:get_value(Key, AssocList, Default).
  -endif.
  
  