diff --git a/lambdabot-irc-plugins.cabal b/lambdabot-irc-plugins.cabal
--- a/lambdabot-irc-plugins.cabal
+++ b/lambdabot-irc-plugins.cabal
@@ -1,5 +1,5 @@
 name:                   lambdabot-irc-plugins
-version:                5.1.0.4
+version:                5.2
 
 license:                GPL
 license-file:           LICENSE
@@ -50,10 +50,10 @@
                         containers              >= 0.4,
                         directory               >= 1.1,
                         filepath                >= 1.3,
-                        lambdabot-core          >= 5.1 && < 5.2,
+                        lambdabot-core          >= 5.2 && < 5.3,
                         lifted-base             >= 0.2,
                         mtl                     >= 2,
-                        network                 >= 2.3.0.13,
-                        time                    >= 1.4,
+                        network                 >= 2.7 && < 3.2,
                         SafeSemaphore           >= 0.9,
-                        split                   >= 0.2
+                        split                   >= 0.2,
+                        time                    >= 1.4
diff --git a/src/Lambdabot/Plugin/IRC/IRC.hs b/src/Lambdabot/Plugin/IRC/IRC.hs
--- a/src/Lambdabot/Plugin/IRC/IRC.hs
+++ b/src/Lambdabot/Plugin/IRC/IRC.hs
@@ -19,7 +19,8 @@
 import Data.List
 import Data.List.Split
 import qualified Data.Map as M
-import Network( connectTo, PortID(..) )
+import Lambdabot.Util.Network (connectTo')
+import Network.Socket (PortNumber)
 import System.IO
 import System.Timeout.Lifted
 import Data.IORef
@@ -40,7 +41,7 @@
             , process = \rest ->
                 case splitOn " " rest of
                     tag:hostn:portn:nickn:uix -> do
-                        pn <- (PortNumber . fromInteger) `fmap` readM portn
+                        pn <- fromInteger `fmap` readM portn
                         lift (online tag hostn pn nickn (intercalate " " uix))
                     _ -> say "Not enough parameters!"
             }
@@ -50,7 +51,7 @@
             , process = \rest ->
                 case splitOn " " rest of
                     tag:hostn:portn:nickn:uix -> do
-                        pn <- (PortNumber . fromInteger) `fmap` readM portn
+                        pn <- fromInteger `fmap` readM portn
                         lift (online tag hostn pn nickn (intercalate " " uix))
                         lift $ lift $ modify $ \state' -> state' { ircPersists = M.insert tag True $ ircPersists state' }
                     _ -> say "Not enough parameters!"
@@ -143,13 +144,13 @@
 -- We have a main loop which reads offline commands, and synchronously
 -- interprets them.
 
-online :: String -> String -> PortID -> String -> String -> IRC ()
+online :: String -> String -> PortNumber -> String -> String -> IRC ()
 online tag hostn portnum nickn ui = do
     pwd <- password `fmap` readMS
     modifyMS $ \ms -> ms{ password = Nothing }
 
     let online' = do
-        sock    <- io $ connectTo hostn portnum
+        sock    <- io $ connectTo' hostn portnum
         io $ hSetBuffering sock NoBuffering
         -- Implements flood control: RFC 2813, section 5.8
         sem1    <- io $ SSem.new 0
