diff --git a/Network/Socket/ByteString/Lazy.hsc b/Network/Socket/ByteString/Lazy.hsc
--- a/Network/Socket/ByteString/Lazy.hsc
+++ b/Network/Socket/ByteString/Lazy.hsc
@@ -25,13 +25,13 @@
   (
 #if !defined(mingw32_HOST_OS)
     -- * Send data to a socket
-    send,
-    sendAll,
+      send
+    , sendAll
 #endif
 
     -- * Receive data from a socket
-    getContents,
-    recv
+    , getContents
+    , recv
   ) where
 
 import Control.Monad (liftM)
@@ -45,7 +45,7 @@
 import qualified Network.Socket.ByteString as N
 
 #if !defined(mingw32_HOST_OS)
-import Control.Monad (when)
+import Control.Monad (unless)
 import Data.ByteString.Unsafe (unsafeUseAsCStringLen)
 import Foreign.Marshal.Array (allocaArray)
 import Foreign.Ptr (plusPtr)
@@ -112,7 +112,8 @@
         -> IO ()
 sendAll sock bs = do
   sent <- send sock bs
-  when (sent < L.length bs) $ sendAll sock (L.drop sent bs)
+  let bs' = L.drop sent bs
+  unless (L.null bs') $ sendAll sock bs'
 #endif
 
 -- -----------------------------------------------------------------------------
diff --git a/network-bytestring.cabal b/network-bytestring.cabal
--- a/network-bytestring.cabal
+++ b/network-bytestring.cabal
@@ -1,5 +1,5 @@
 name:                network-bytestring
-version:             0.1.3
+version:             0.1.3.1
 synopsis:            Fast, memory-efficient, low-level networking
 description:         Fast, memory-efficient, low-level socket functions
                      that use 'Data.ByteString's instead of 'String's.
@@ -26,7 +26,7 @@
       Network.Socket.ByteString.MsgHdr
 
   build-depends:
-    base       < 4.3,
+    base       < 4.4,
     bytestring < 1.0,
     network    >= 2.2.1.1 && < 2.3
 
diff --git a/tests/Simple.hs b/tests/Simple.hs
--- a/tests/Simple.hs
+++ b/tests/Simple.hs
@@ -131,10 +131,11 @@
     when (errors counts + failures counts > 0) exitFailure
 
 tests :: Test
-tests = TestList [TestLabel "testLazySend" testLazySend,
-                  TestLabel "testSendAll" testSendMany,
-                  TestLabel "testSendMany" testSendMany,
-                  TestLabel "testRecv" testRecv,
-                  TestLabel "testOverFlowRecv" testOverFlowRecv,
-                  TestLabel "testRecvFrom" testRecvFrom,
-                  TestLabel "testOverFlowRecvFrom" testOverFlowRecvFrom]
+tests = TestList [ TestLabel "testLazySend" testLazySend
+                 , TestLabel "testSendAll" testSendMany
+                 , TestLabel "testSendMany" testSendMany
+                 , TestLabel "testRecv" testRecv
+                 , TestLabel "testOverFlowRecv" testOverFlowRecv
+                 , TestLabel "testRecvFrom" testRecvFrom
+                 , TestLabel "testOverFlowRecvFrom" testOverFlowRecvFrom
+                 ]
