anchor.diff:      ?debug("Handshake request: ~p", [HReq]),
       NewFuseId = genFuseId(HReq),
       UID = case DnString =:= undefined of %% Fetch user's ID
  -        false ->
  -            case user_logic:get_user({dn, DnString}) of
  -                {ok, #veil_document{uuid = UID1}} ->
  -                    UID1;
  -                {error, Error} ->
  -                    case user_logic:get_user({unverified_dn, DnString}) of
  -                        {ok, #veil_document{uuid = UID1, record = #user{login = Login}} = UserDoc} ->
  -                            case CertConfirmation of
  -                                #handshakerequest_certconfirmation{login = Login, result = Result} ->
  -                                    % Remove the DN from unverified DNs as it has been confirmed or declined
  -                                    {ok, UserDoc2} = user_logic:update_unverified_dn_list(UserDoc, user_logic:get_unverified_dn_list(UserDoc) -- [DnString]),
  -                                    case Result of
  -                                        false ->
  -                                            ?alert("Private key owner denied having added a certificate with DN: ~p (added by ~p)", [DnString, Login]),
  -                                            throw({cert_denied_by_user, MsgId});
  -                                        true ->
  -                                            {ok, _} = user_logic:update_dn_list(UserDoc2, user_logic:get_dn_list(UserDoc2) ++ [DnString]),
  -                                            ?debug("User ~p confirmed a certificate with DN: ~p", [Login, DnString]),
  -                                            UID1
  -                                    end;
  -                                _ ->
  -                                    ?debug("Handshake request is missing confirmation of certificate with DN: ~p. Denying connection.", [DnString]),
  -                                    throw({cert_confirmation_required, Login, MsgId})
  -                            end;
  -                        {error, _} ->
  -                            ?error("VeilClient handshake failed. User (DN: ~p) data is not available due to DAO error: ~p", [DnString, Error]),
  -                            throw({no_user_found_error, Error, MsgId})
  -                    end
  -            end;
  -
  -        true ->
  -            case user_logic:get_user({global_id, vcn_utils:ensure_list(GRUID)}) of
  -                {ok, #veil_document{uuid = UID1}} ->
  -                    UID1;
  -                {error, Error} ->
  -                    ?error("VeilClient handshake failed. User (GRUID: ~p) data is not available due to DAO error: ~p", [GRUID, Error]),
  -                    throw({no_user_found_error, Error, MsgId})
  -            end
  -    end,
  +              false ->
  +                  case user_logic:get_user({dn, DnString}) of
  +                      {ok, #veil_document{uuid = UID1}} ->
  +                          UID1;
  +                      {error, Error} ->
  +                          case user_logic:get_user({unverified_dn, DnString}) of
  +                              {ok, #veil_document{uuid = UID1, record = #user{login = Login}} = UserDoc} ->
  +                                  case CertConfirmation of
  +                                      #handshakerequest_certconfirmation{login = Login, result = Result} ->
  +                                          % Remove the DN from unverified DNs as it has been confirmed or declined
  +                                          {ok, UserDoc2} = user_logic:update_unverified_dn_list(UserDoc, user_logic:get_unverified_dn_list(UserDoc) -- [DnString]),
  +                                          case Result of
  +                                              false ->
  +                                                  ?alert("Private key owner denied having added a certificate with DN: ~p (added by ~p)", [DnString, Login]),
  +                                                  throw({cert_denied_by_user, MsgId});
  +                                              true ->
  +                                                  {ok, _} = user_logic:update_dn_list(UserDoc2, user_logic:get_dn_list(UserDoc2) ++ [DnString]),
  +                                                  ?debug("User ~p confirmed a certificate with DN: ~p", [Login, DnString]),
  +                                                  UID1
  +                                          end;
  +                                      _ ->
  +                                          ?debug("Handshake request is missing confirmation of certificate with DN: ~p. Denying connection.", [DnString]),
  +                                          throw({cert_confirmation_required, Login, MsgId})
  +                                  end;
  +                              {error, _} ->
  +                                  ?error("VeilClient handshake failed. User (DN: ~p) data is not available due to DAO error: ~p", [DnString, Error]),
  +                                  throw({no_user_found_error, Error, MsgId})
  +                          end
  +                  end;
  +
  +              true ->
  +                  case user_logic:get_user({global_id, vcn_utils:ensure_list(GRUID)}) of
  +                      {ok, #veil_document{uuid = UID1}} ->
  +                          UID1;
  +                      {error, Error} ->
  +                          ?error("VeilClient handshake failed. User (GRUID: ~p) data is not available due to DAO error: ~p", [GRUID, Error]),
  +                          throw({no_user_found_error, Error, MsgId})
  +                  end
  +          end,
   
       %% Env Vars list. Entry format: {Name :: atom(), value :: string()}
       EnvVars = [{list_to_atom(string:to_lower(Name)), Value} || #handshakerequest_envvariable{name = Name, value = Value} <- Vars],
  
positive.code:         end,
  
      case DnString =/= undefined orelse UserGID =/= undefined of
          true  -> ok;
          false -> throw({no_credentials, MsgId})
      end,
  
      Request = case Msg of
                    CallbackMsg when is_record(CallbackMsg, channelregistration) ->
                        #veil_request{subject = DnString, request =
                          #callback{fuse = FuseID, pid = self(), node = node(), action = channelregistration}, access_token = {UserGID, AccessToken}};
                    CallbackMsg2 when is_record(CallbackMsg2, channelclose) ->
                        #veil_request{subject = DnString, request =
                          #callback{fuse = FuseID, pid = self(), node = node(), action = channelclose}, access_token = {UserGID, AccessToken}};
                    _ -> #veil_request{subject = DnString, request = Msg, fuse_id = FuseID, access_token = {UserGID, AccessToken}}
                end,
  
      case Synch of
  
negative.code:                 case Msg of
                      ack ->
                          gen_server:call(?Dispatcher_Name, {node_chosen_for_ack, {Task, ProtocolVersion, Request, MsgId, FuseID}}),
                          {ok, Req, State};
                      %% @todo This is a temporaary matching. It is necessary to avoid infinite logging loop.
                      #logmessage{} ->
                          gen_server:call(?Dispatcher_Name, {node_chosen, {Task, ProtocolVersion, Request}}),
                          {ok, Req, State};
                      _ ->
                          Ans = gen_server:call(?Dispatcher_Name, {node_chosen, {Task, ProtocolVersion, Request}}),
  