diff --git a/mtpd.c b/mtpd.c
index 4943d1e..3c011f0 100644
--- a/mtpd.c
+++ b/mtpd.c
@@ -116,17 +116,17 @@
     args[0] = (*argv)[0];
     for (i = 1; i < 32; ++i) {
         unsigned char bytes[2];
-        if (recv(control, &bytes[0], 1, 0) != 1
-            || recv(control, &bytes[1], 1, 0) != 1) {
+        int length = recv(control, &bytes[0], 1, 0);
+
+        if (!length) {
+            break;
+        } else if (length != 1 || recv(control, &bytes[1], 1, 0) != 1) {
             log_print(FATAL, "Cannot get argument length");
             exit(SYSTEM_ERROR);
         } else {
-            int length = bytes[0] << 8 | bytes[1];
             int offset = 0;
+            length = bytes[0] << 8 | bytes[1];
 
-            if (length == 0xFFFF) {
-                break;
-            }
             args[i] = malloc(length + 1);
             while (offset < length) {
                 int n = recv(control, &args[i][offset], length - offset, 0);
@@ -190,7 +190,7 @@
             break;
         }
         timeout = pollfds[1].revents ?
-            the_protocol->process() : the_protocol->timeout();
+                the_protocol->process() : the_protocol->timeout();
     }
 
     if (timeout < 0) {
@@ -200,7 +200,7 @@
         read(signals[0], &signal, sizeof(int));
         log_print(INFO, "Received signal %d", signal);
         if (signal == SIGCHLD && waitpid(pppd_pid, &status, WNOHANG) == pppd_pid
-            && WIFEXITED(status)) {
+                && WIFEXITED(status)) {
             status = WEXITSTATUS(status);
             log_print(INFO, "Pppd is terminated (status = %d)", status);
             status += PPPD_EXITED;
@@ -256,7 +256,7 @@
     error = getaddrinfo(server, port, &hints, &records);
     if (error) {
         log_print(FATAL, "Getaddrinfo() %s", (error == EAI_SYSTEM) ?
-                  strerror(errno) : gai_strerror(error));
+                strerror(errno) : gai_strerror(error));
         exit(NETWORK_ERROR);
     }
 
