diff --git a/Combinatorrent.cabal b/Combinatorrent.cabal
--- a/Combinatorrent.cabal
+++ b/Combinatorrent.cabal
@@ -1,6 +1,6 @@
 name: Combinatorrent
 category: Network
-version: 0.3.0
+version: 0.3.1
 category: Network
 description:   Combinatorrent provides a BitTorrent client, based on STM
                for concurrency. This is an early preview release which is capable of
diff --git a/src/Process/Peer/Sender.hs b/src/Process/Peer/Sender.hs
--- a/src/Process/Peer/Sender.hs
+++ b/src/Process/Peer/Sender.hs
@@ -36,6 +36,6 @@
    s <- asks sock
    _ <- liftIO $ do
       r <- atomically $ takeTMVar ch
-      send s r
+      sendAll s r
    pgm
 
diff --git a/src/Protocol/Wire.hs b/src/Protocol/Wire.hs
--- a/src/Protocol/Wire.hs
+++ b/src/Protocol/Wire.hs
@@ -336,7 +336,9 @@
 constructBitField :: Int -> [PieceNum] -> B.ByteString
 constructBitField sz pieces = B.pack . build $ m
     where m = map (`elem` pieces) [0..sz-1 + pad]
-          pad = 8 - (sz `mod` 8)
+          pad = case sz `mod` 8 of
+                    0 -> 0
+                    n -> 8 - n
           build [] = []
           build l = let (first, rest) = splitAt 8 l
                     in if length first /= 8
