diff --git a/Devel.hs b/Devel.hs
--- a/Devel.hs
+++ b/Devel.hs
@@ -84,23 +84,24 @@
 import           SrcLoc                                (Located)
 import           Data.FileEmbed        (embedFile)
 
-lockFile :: DevelOpts -> FilePath
-lockFile _opts =  "yesod-devel/devel-terminate"
+lockFile :: FilePath
+lockFile =  "yesod-devel/devel-terminate"
 
 writeLock :: DevelOpts -> IO ()
 writeLock opts = do
     createDirectoryIfMissing True "yesod-devel"
-    writeFile (lockFile opts) ""
+    writeFile lockFile ""
     createDirectoryIfMissing True "dist" -- for compatibility with old devel.hs
     writeFile "dist/devel-terminate" ""
 
 removeLock :: DevelOpts -> IO ()
 removeLock opts = do
-    removeFileIfExists (lockFile opts)
+    removeFileIfExists lockFile
     removeFileIfExists "dist/devel-terminate"  -- for compatibility with old devel.hs
 
 data DevelTermOpt = TerminateOnEnter | TerminateOnlyInterrupt
      deriving (Show, Eq)
+     
 data DevelOpts = DevelOpts
       { isCabalDev   :: Bool
       , forceCabal   :: Bool
@@ -136,8 +137,9 @@
     }
 
 cabalProgram :: DevelOpts -> FilePath
-cabalProgram opts | isCabalDev opts = "cabal-dev"
-                  | otherwise       = "cabal"
+cabalProgram opts
+  | isCabalDev opts = "cabal-dev"
+  | otherwise       = "cabal"
 
 -- | Run a reverse proxy from port 3000 to 3001. If there is no response on
 -- 3001, give an appropriate message to the user.
@@ -207,7 +209,8 @@
             return True
 
 getPort :: DevelOpts -> Int -> IO Int
-getPort opts _ | not (useReverseProxy opts) = return $ develPort opts
+getPort opts _ 
+  | not (useReverseProxy opts) = return $ develPort opts
 getPort _ p0 =
     loop p0
   where
@@ -504,7 +507,11 @@
 
 lookupLdAr' :: IO (Maybe (FilePath, FilePath))
 lookupLdAr' = do
+#if MIN_VERSION_Cabal(1,22,0)
+  (_, _, pgmc) <- D.configCompilerEx (Just D.GHC) Nothing Nothing D.defaultProgramConfiguration D.silent
+#else
   (_, pgmc) <- D.configCompiler (Just D.GHC) Nothing Nothing D.defaultProgramConfiguration D.silent
+#endif
   pgmc' <- D.configureAllKnownPrograms D.silent pgmc
   return $ (,) <$> look D.ldProgram pgmc' <*> look D.arProgram pgmc'
      where
diff --git a/Keter.hs b/Keter.hs
--- a/Keter.hs
+++ b/Keter.hs
@@ -81,9 +81,20 @@
 
     unless noCopyTo $ case Map.lookup "copy-to" value of
         Just (String s) ->
-            case parseMaybe (.: "copy-to-port") value of
-                Just i -> run "scp" ["-P" ++ show (i :: Int), fp, T.unpack s]
-                Nothing -> run "scp" [fp, T.unpack s]
+            let baseArgs = [fp, T.unpack s] :: [String]
+
+                scpArgs =
+                    case parseMaybe (.: "copy-to-args") value of
+                        Just as -> as ++ baseArgs
+                        Nothing -> baseArgs
+
+                args =
+                    case parseMaybe (.: "copy-to-port") value of
+                        Just i -> "-P" : show (i :: Int) : scpArgs
+                        Nothing -> scpArgs
+
+            in run "scp" args
+
         _ -> return ()
   where
     -- Test for alternative config file extension (yaml or yml).
diff --git a/yesod-bin.cabal b/yesod-bin.cabal
--- a/yesod-bin.cabal
+++ b/yesod-bin.cabal
@@ -1,5 +1,5 @@
 name:            yesod-bin
-version:         1.4.7
+version:         1.4.7.1
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -61,7 +61,7 @@
                      , blaze-builder      >= 0.2.1.4      && < 0.5
                      , filepath           >= 1.1
                      , process
-                     , zlib               >= 0.5          && < 0.6
+                     , zlib               >= 0.5
                      , tar                >= 0.4          && < 0.5
                      , system-filepath    >= 0.4          && < 0.5
                      , system-fileio      >= 0.3          && < 0.4
