diff --git a/dap-sdk/net/server/http_server/http_client/dap_http_client.c b/dap-sdk/net/server/http_server/http_client/dap_http_client.c
index bb6da1659f00e2d9979d33761ae8a95f69837f2e..e5396b71c0f069ad5a1baea5b3ae36643c74344d 100644
--- a/dap-sdk/net/server/http_server/http_client/dap_http_client.c
+++ b/dap-sdk/net/server/http_server/http_client/dap_http_client.c
@@ -89,7 +89,7 @@ void dap_http_client_new( dap_events_socket_t *a_esocket, void *a_arg )
 
     pthread_rwlock_rdlock(&l_http_client->http->url_proc->cache_rwlock);
     if(l_http_client->http->url_proc->cache){
-        if ( ! l_http_client->http->url_proc->cache->ts_expire || l_http_client->http->url_proc->cache->ts_expire < time(NULL) ){
+        if ( ! l_http_client->http->url_proc->cache->ts_expire || l_http_client->http->url_proc->cache->ts_expire >= time(NULL) ){
             l_http_client->out_headers = dap_http_headers_dup(l_http_client->http->url_proc->cache->headers);
             if(s_debug_http)
                 log_it(L_DEBUG,"%d Out: prepare cached headers", l_http_client->esocket->socket);
@@ -557,7 +557,7 @@ void dap_http_client_write( dap_events_socket_t * a_esocket, void *a_arg )
                 if  ( ( l_http_client->proc->cache == NULL &&
                         l_http_client->proc->data_write_callback ) ||
                       ( l_http_client->proc->data_write_callback &&
-                        l_http_client->http->url_proc->cache->ts_expire >= time(NULL) &&
+                        l_http_client->http->url_proc->cache->ts_expire < time(NULL) &&
                         l_http_client->out_cache_position == NULL // Check if we haven't started
                                                                   // to share cached data
                         )
@@ -569,7 +569,9 @@ void dap_http_client_write( dap_events_socket_t * a_esocket, void *a_arg )
                         l_http_client->http->url_proc->cache = NULL;
                         if(s_debug_http)
                             log_it(L_NOTICE,"Cache expired and dropped out");
-                    }
+                    }else if (s_debug_http)
+                        log_it(L_DEBUG, "No cache so we call write callback");
+
                     pthread_rwlock_unlock(&l_http_client->proc->cache_rwlock);
                     l_http_client->proc->data_write_callback( l_http_client, NULL );
                 }else if(l_http_client->proc->cache) {
diff --git a/modules/channel/chain/dap_stream_ch_chain.c b/modules/channel/chain/dap_stream_ch_chain.c
index 939474bba40444028711ae963faa4fe7d0b948f3..943ed33ab1f62c281bddd84f3b5ef8235ffcc327 100644
--- a/modules/channel/chain/dap_stream_ch_chain.c
+++ b/modules/channel/chain/dap_stream_ch_chain.c
@@ -187,7 +187,7 @@ static bool s_stream_ch_delete_in_proc(dap_proc_thread_t * a_thread, void * a_ar
 {
     (void) a_thread;
     dap_stream_ch_chain_t * l_ch_chain=(dap_stream_ch_chain_t*) a_arg;
-    dap_stream_ch_chain_hash_item_t * l_item, *l_tmp;
+    dap_stream_ch_chain_hash_item_t * l_item = NULL, *l_tmp = NULL;
 
     // Clear remote atoms
     HASH_ITER(hh, l_ch_chain->remote_atoms, l_item, l_tmp){
@@ -307,7 +307,7 @@ static bool s_sync_out_chains_proc_callback(dap_proc_thread_t *a_thread, void *a
     if (l_iter && l_first_size) {
         // first packet
         if (!dap_hash_fast_is_blank(&l_sync_request->request.hash_from)) {
-            l_iter = l_chain->callback_atom_find_by_hash(l_sync_request->chain.request_atom_iter,
+            (void ) l_chain->callback_atom_find_by_hash(l_sync_request->chain.request_atom_iter,
                                                           &l_sync_request->request.hash_from, &l_first_size);
         }