diff --git a/common.c b/common.c
index 8426e60..4977a4c 100644
--- a/common.c
+++ b/common.c
@@ -97,12 +97,12 @@ int make_listen_tfo(int s)
 
     /* Don't do it if not supported */
     if (!TCP_FASTOPEN)
-        return;
+        return 0;
 
     /* Don't do it if any protocol does not specify it */
     for (i = 0; i < cfg.protocols_len; i++) {
         if (! cfg.protocols[i].tfo_ok)
-            return;
+            return 0;
     }
 
     return setsockopt(s, SOL_SOCKET, TCP_FASTOPEN, (char*)&qlen, sizeof(qlen));
diff --git a/echosrv.c b/echosrv.c
index e5838d2..66a9675 100644
--- a/echosrv.c
+++ b/echosrv.c
@@ -106,7 +106,7 @@ void start_echo(int fd)
     strcpy(buffer, prefix);
 
     while (1) {
-        ret = read(fd, buffer + prefix_len, sizeof(buffer));
+        ret = read(fd, buffer + prefix_len, sizeof(buffer) - prefix_len);
         if (ret == -1) {
             fprintf(stderr, "%s", strerror(errno));
             return;
diff --git a/sslh-main.c b/sslh-main.c
index bd3594e..0fa0994 100644
--- a/sslh-main.c
+++ b/sslh-main.c
@@ -115,7 +115,7 @@ static void printsettings(void)
 }
 
 
-/* To removed in v1.21 */
+/* To be removed in v1.21 */
 const char* ssl_err_msg = "Usage of 'ssl' setting is deprecated and will be removed in v1.21. Please use 'tls' instead\n";
 void ssl_to_tls(char* setting)
 {
@@ -126,7 +126,7 @@ void ssl_to_tls(char* setting)
 }
 
 
-/* Turn 'ssl' command line option to 'tls'. To removed in v1.21 */
+/* Turn 'ssl' command line option to 'tls'. To be removed in v1.21 */
 void cmd_ssl_to_tls(int argc, char* argv[])
 {
     int i;
@@ -135,7 +135,7 @@ void cmd_ssl_to_tls(int argc, char* argv[])
             strcpy(argv[i], "--tls");
             /* foreground option not parsed yet, syslog not open, just print on
              * stderr and hope for the best */
-            fprintf(stderr, ssl_err_msg);
+            fprintf(stderr, "%s", ssl_err_msg);
         }
     }
 }
@@ -224,11 +224,11 @@ static void config_protocols()
             cfg.protocols[i].data = (void*)new_tls_data();
             if (cfg.protocols[i].sni_hostnames_len)
                 tls_data_set_list(cfg.protocols[i].data, 0,
-                                  cfg.protocols[i].sni_hostnames,
+                                  (const char**) cfg.protocols[i].sni_hostnames,
                                   cfg.protocols[i].sni_hostnames_len);
             if (cfg.protocols[i].alpn_protocols_len)
                 tls_data_set_list(cfg.protocols[i].data, 1, 
-                                  cfg.protocols[i].alpn_protocols,
+                                  (const char**) cfg.protocols[i].alpn_protocols,
                                   cfg.protocols[i].alpn_protocols_len);
         }
     }