anchor.diff:              exit(badarg)
        end || Opt <- Opts].
   
  -normalize_getopts(Opts) ->
  +internalize_getopts(Opts) ->
       [case Opt of
  -         Tag when is_atom(Tag)    -> Opt;
  -         {raw, _}                 -> Opt;
  -         {raw, Level, Key, Value} -> {raw, {Level, Key, Value}};
  -         _                        -> exit(badarg)
  +         Tag when is_atom(Tag)        -> Opt;
  +         {raw, _}                     -> Opt;
  +         {raw, Level, Key, ValueSpec} -> {raw, {Level, Key, ValueSpec}};
  +         _                            -> exit(badarg)
        end || Opt <- Opts].
   
  +externalize_getopts(Opts) ->
  +    [case Opt of
  +         {raw, {Level, Key, Value}} -> {raw, Level, Key, Value};
  +         {Tag, _} when is_atom(Tag) -> Opt;
  +         _                          -> exit(badarg)
  +     end || Opt <- Opts].
  + 
   %%
   %% -------
   %% Split options into server start options and other options.
  
positive.code: socket_getopt(Socket, raw, Val) ->
      case Val of
          {Level, Key, ValueSpec} ->
              socket:getopt_native(Socket, {Level,Key}, ValueSpec);
          _ ->
              {error, einval}
      end;
  
negative.code: %% Call: getopts/1
  handle_event({call, From}, {getopts, Opts}, State, {P, D}) ->
      %% ?DBG({call, getopts, Opts, State, D}),
      Result = case state_getopts(P, D, State, Opts) of
                   {ok, OptVals} ->
                       {ok, externalize_getopts(OptVals)};
                   {error, _} = ERROR ->
                       ERROR
               end,
      %% ?DBG({call, getopts_result, Result}),
      {keep_state_and_data,
       [{reply, From, Result}]};
  