diff --git a/Network/Shed/Httpd.hs b/Network/Shed/Httpd.hs
--- a/Network/Shed/Httpd.hs
+++ b/Network/Shed/Httpd.hs
@@ -32,21 +32,23 @@
     , contentType
     ) where
 
---import System.Posix
---import System.Posix.Signals
-import Network.URI
-import Network
-import System.IO 
-import Control.Monad 
-import Control.Concurrent 
-import Control.Exception as Exc
-import qualified Data.List as List
+import qualified Network as Network
+import qualified Network.Socket as Socket
+import Network.URI (URI, parseURIReference, unEscapeString)
+import Network.BSD (getProtocolNumber)
+import Network.Socket (
+          SockAddr(SockAddrInet), iNADDR_ANY,
+          bindSocket, setSocketOption, socket)
+
+import Control.Concurrent (forkIO)
+import Control.Exception (finally)
+
+import System.IO (Handle, hPutStr, hClose, hGetLine, hGetContents)
+
 import qualified Data.Char as Char
 import Numeric (showHex)
-import qualified Network as N
-import Network.BSD
-import Network.Socket
 
+
 type Server = () -- later, we might have a handle for shutting down a server.
 
 {- |
@@ -104,7 +106,7 @@
 -}
 initServerBind
    :: Int                               -- ^ The port number
-   -> HostAddress                       -- ^ The host address
+   -> Socket.HostAddress                -- ^ The host address
    -> (Request -> IO Response)          -- ^ The functionality of the Server
    -> IO Server                         -- ^ A token for the Server
 initServerBind port addr =
@@ -122,13 +124,13 @@
 --        installHandler sigPIPE Ignore Nothing    
 --        sock  <- listenOn (PortNumber $ fromIntegral portNo)
         num <- getProtocolNumber "tcp"
-        sock <- socket AF_INET Stream num
-        setSocketOption sock ReuseAddr 1
+        sock <- socket Socket.AF_INET Socket.Stream num
+        setSocketOption sock Socket.ReuseAddr 1
         bindSocket sock sockAddr
-        listen sock maxListenQueue
+        Socket.listen sock Socket.maxListenQueue
 
         loopIO  
-           (do (h,_nm,_port) <- N.accept sock
+           (do (h,_nm,_port) <- Network.accept sock
                forkIO $ do 
                  ln <- hGetLine h
                  case words ln of
@@ -139,10 +141,9 @@
                                  hClose h
                    _                      -> hClose h
                  return ()
-           ) `finally` sClose sock
+           ) `finally` Socket.sClose sock
   where 
-      loopIO m          = do m
-                             loopIO m
+      loopIO m = m >> loopIO m
 
       readHeaders h mode uri hds clen = do
         line <- hGetLine h
diff --git a/httpd-shed.cabal b/httpd-shed.cabal
--- a/httpd-shed.cabal
+++ b/httpd-shed.cabal
@@ -1,5 +1,5 @@
 Name:           httpd-shed
-Version:        0.4
+Version:        0.4.0.1
 Cabal-Version:  >= 1.2
 License:        BSD3
 License-File:   LICENSE
@@ -13,17 +13,34 @@
 
 Maintainer:     Andy Gill
 Copyright:      (c) 2009 Andy Gill
-build-type:     Simple
+Build-Type:     Simple
+cabal-version:  >= 1.6
 
+Source-Repository this
+  Tag:         0.4.0.1
+  Type:        git
+  Location:    https://github.com/andygill/httpd-shed/
+
+Source-Repository head
+  Type:        git
+  Location:    https://github.com/andygill/httpd-shed/
+
+Flag buildExamples
+  Description: Build example executables
+  Default:     False
+
 Library
-  Build-Depends:        base >= 4.0 && < 5.0, network
-  ghc-options: -Wall
+  Build-Depends:
+    network >=2.3 && <2.5,
+    base >=4.0 && <5.0
+  Ghc-Options: -Wall
   Exposed-modules:
     Network.Shed.Httpd
 
 
 -- Trivial test; we need real tests!
 Executable httpd-shed-test
+  If !flag(buildExamples)
+    Buildable: False
   Main-Is:        Main.hs
   Hs-Source-Dirs: ., test
-  buildable: True
