diff --git a/stream/dap_stream.c b/stream/dap_stream.c
index 5b06c950f2a4c00aa8ebc3de21f8576271493dd2..46a8042be4639694beaa2858b4606a6c3e93898b 100755
--- a/stream/dap_stream.c
+++ b/stream/dap_stream.c
@@ -164,7 +164,7 @@ void stream_headers_read(dap_http_client_t * cl_ht, void * arg)
                 cl_ht->reply_status_code=404;
                 strcpy(cl_ht->reply_reason_phrase,"Not found");
             }else{
-                log_it(L_INFO,"Session id %u was found with media_id = %d",id,ss->media_id);
+                log_it(L_INFO,"Session id %u was found with channels = %s",id,ss->active_channels);
                 if(dap_stream_session_open(ss)==0){ // Create new stream
                     dap_stream_t * sid = stream_new(cl_ht);
                     sid->session=ss;
diff --git a/stream/dap_stream_ctl.c b/stream/dap_stream_ctl.c
index e4095d6362f399e4c67f43b6e8a70bb23bd3c802..18cba9c5c1e9a5b1e3bbae39ed1d72bceb7194e3 100755
--- a/stream/dap_stream_ctl.c
+++ b/stream/dap_stream_ctl.c
@@ -101,24 +101,24 @@ void stream_ctl_proc(struct dap_http_simple *cl_st, void * arg)
    // unsigned int action_cmd=0;
     bool l_new_session = false;
 
-    enc_http_delegate_t *dg = enc_http_request_decode(cl_st);
+    enc_http_delegate_t *l_dg = enc_http_request_decode(cl_st);
 
-    if(dg){
+    if(l_dg){
         size_t l_channels_str_size = sizeof(ss->active_channels);
-        char l_channels_str[l_channels_str_size];
-        if(dg->url_path && strlen(dg->url_path) < 30 &&
-                sscanf(dg->url_path, "stream_ctl,channels=%s", l_channels_str) == 1) {
+        char l_channels_str[sizeof(ss->active_channels)];
+        if(l_dg->url_path && strlen(l_dg->url_path) < 30 &&
+                sscanf(l_dg->url_path, "stream_ctl,channels=%s", l_channels_str) == 1) {
             l_new_session = true;
         }
-        else if(strcmp(dg->url_path, "socket_forward" ) == 0) {
+        else if(strcmp(l_dg->url_path, "socket_forward" ) == 0) {
             l_new_session = true;
         }
         /* }else if (strcmp(dg->url_path,"stream_ctl")==0) {
             l_new_session = true;
         }*/
         else{
-            log_it(L_ERROR,"ctl command unknown: %s",dg->url_path);
-            enc_http_delegate_delete(dg);
+            log_it(L_ERROR,"ctl command unknown: %s",l_dg->url_path);
+            enc_http_delegate_delete(l_dg);
             *return_code = Http_Status_MethodNotAllowed;
             return;
         }
@@ -130,19 +130,19 @@ void stream_ctl_proc(struct dap_http_simple *cl_st, void * arg)
             dap_random_string_fill(key_str, KEX_KEY_STR_SIZE);
             ss->key = dap_enc_key_new_generate(s_socket_forward_key.type, key_str, KEX_KEY_STR_SIZE,
                                                NULL, 0, s_socket_forward_key.size);
-            enc_http_reply_f(dg,"%u %s",ss->id,key_str);
+            enc_http_reply_f(l_dg,"%u %s",ss->id,key_str);
             *return_code = Http_Status_OK;
 
             log_it(L_INFO," New stream session %u initialized",ss->id);
 
             free(key_str);
         }else{
-            log_it(L_ERROR,"Wrong request: \"%s\"",dg->in_query);
+            log_it(L_ERROR,"Wrong request: \"%s\"",l_dg->in_query);
             *return_code = Http_Status_BadRequest;
         }
 
         unsigned int conn_t = 0;
-        char *ct_str = strstr(dg->in_query, "connection_type");
+        char *ct_str = strstr(l_dg->in_query, "connection_type");
         if (ct_str)
         {
             sscanf(ct_str, "connection_type=%u", &conn_t);
@@ -161,8 +161,8 @@ void stream_ctl_proc(struct dap_http_simple *cl_st, void * arg)
 
         log_it(L_INFO,"setup connection_type: %s", connection_type_str[conn_t]);
 
-        enc_http_reply_encode(cl_st,dg);
-        enc_http_delegate_delete(dg);
+        enc_http_reply_encode(cl_st,l_dg);
+        enc_http_delegate_delete(l_dg);
     }else{
         log_it(L_ERROR,"No encryption layer was initialized well");
         *return_code = Http_Status_BadRequest;