diff --git a/src/httpd.hpp b/src/httpd.hpp
index c6756850b55a7daf7ae73325424519ec04a70090..faaa55dbe7a6c32a744763755e313d47368ac3a6 100644
--- a/src/httpd.hpp
+++ b/src/httpd.hpp
@@ -6,6 +6,8 @@
 #include <unordered_map>
 #include <functional>
 
+#include <netinet/in.h>
+
 #include "http_err.hpp"
 #include "http_request.hpp"
 #include "http_response.hpp"
diff --git a/src/threadpool.cpp b/src/threadpool.cpp
index 4ed3ec17b564a5b52f24964823b37adde89e6feb..9dc25e04475c35c030681b015b1fb6c116a5755b 100644
--- a/src/threadpool.cpp
+++ b/src/threadpool.cpp
@@ -21,6 +21,8 @@ Threadpool::Threadpool(int _numberOfWorkers, int _maxQueueBacklog)
         // is double the amount of physical cores. So on a modern machine with hyperthreading
         // the number of worker threads will be equivalent to the number of "real" cpu cores
         numberOfWorkers = std::thread::hardware_concurrency() / 2;
+
+        if (numberOfWorkers < 1) numberOfWorkers = 1;
     }
 
     if (maxQueueBacklog != DISABLE_MAX_QUEUE_BACKLOG)