diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 1.4.7.2
+
+* Scaffolding updates, including fix for [#982](https://github.com/yesodweb/yesod/issues/982)
+
 ## 1.4.7
 
 * GHC 7.10 support
diff --git a/Scaffolding/Scaffolder.hs b/Scaffolding/Scaffolder.hs
--- a/Scaffolding/Scaffolder.hs
+++ b/Scaffolding/Scaffolder.hs
@@ -92,7 +92,9 @@
 
     let sink = unpackTemplate
                 (receiveFS $ if isBare then "." else fromString project)
-                (T.replace "PROJECTNAME" (T.pack project))
+                ( T.replace "PROJECTNAME" (T.pack project)
+                . T.replace "PROJECTNAME_LOWER" (T.toLower $ T.pack project)
+                )
     case ebackend of
         Left req -> withManager $ \m -> do
             res <- http req m
diff --git a/hsfiles/mysql.hsfiles b/hsfiles/mysql.hsfiles
--- a/hsfiles/mysql.hsfiles
+++ b/hsfiles/mysql.hsfiles
@@ -101,6 +101,9 @@
     -- temporary foundation without a real connection pool, get a log function
     -- from there, and then create the real foundation.
     let mkFoundation appConnPool = App {..}
+        -- The App {..} syntax is an example of record wild cards. For more
+        -- information, see:
+        -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html
         tempFoundation = mkFoundation $ error "connPool forced in tempFoundation"
         logFunc = messageLoggerSource tempFoundation appLogger
 
@@ -9159,19 +9162,17 @@
 -- 'withApp' calls it before each test, creating a clean environment for each
 -- spec to run in.
 wipeDB :: App -> IO ()
-wipeDB app = do
-    runDBWithApp app $ do
-        tables <- getTables
-        sqlBackend <- ask
-        let queries = map (\t -> "TRUNCATE TABLE " ++ (connEscapeName sqlBackend $ DBName t)) tables
+wipeDB app = runDBWithApp app $ do
+    tables <- getTables
+    sqlBackend <- ask
+    let queries = map (\t -> "TRUNCATE TABLE " ++ connEscapeName sqlBackend (DBName t)) tables
 
-        -- In MySQL, a table cannot be truncated if another table references it via foreign key.
-        -- Since we're wiping both the parent and child tables, though, it's safe
-        -- to temporarily disable this check.
-        rawExecute "SET foreign_key_checks = 0;" []
-        forM_ queries (\q -> rawExecute q [])
-        rawExecute "SET foreign_key_checks = 1;" []
-    return ()
+    -- In MySQL, a table cannot be truncated if another table references it via foreign key.
+    -- Since we're wiping both the parent and child tables, though, it's safe
+    -- to temporarily disable this check.
+    rawExecute "SET foreign_key_checks = 0;" []
+    forM_ queries (\q -> rawExecute q [])
+    rawExecute "SET foreign_key_checks = 1;" []
 
 getTables :: MonadIO m => ReaderT SqlBackend m [Text]
 getTables = do
diff --git a/hsfiles/postgres-fay.hsfiles b/hsfiles/postgres-fay.hsfiles
--- a/hsfiles/postgres-fay.hsfiles
+++ b/hsfiles/postgres-fay.hsfiles
@@ -107,6 +107,9 @@
     -- temporary foundation without a real connection pool, get a log function
     -- from there, and then create the real foundation.
     let mkFoundation appConnPool = App {..}
+        -- The App {..} syntax is an example of record wild cards. For more
+        -- information, see:
+        -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html
         tempFoundation = mkFoundation $ error "connPool forced in tempFoundation"
         logFunc = messageLoggerSource tempFoundation appLogger
 
@@ -1062,11 +1065,11 @@
 # skip-combining: false
 
 database:
-  user:     "_env:PGUSER:PROJECTNAME"
+  user:     "_env:PGUSER:PROJECTNAME_LOWER"
   password: "_env:PGPASS:PROJECTNAME"
   host:     "_env:PGHOST:localhost"
   port:     "_env:PGPORT:5432"
-  database: "_env:PGDATABASE:PROJECTNAME"
+  database: "_env:PGDATABASE:PROJECTNAME_LOWER"
   poolsize: "_env:PGPOOLSIZE:10"
 
 copyright: Insert copyright statement here
@@ -1074,7 +1077,7 @@
 
 {-# START_FILE config/test-settings.yml #-}
 database:
-  database: PROJECTNAME_test
+  database: PROJECTNAME_LOWER_test
 
 {-# START_FILE fay-shared/SharedTypes.hs #-}
 {-# LANGUAGE NoImplicitPrelude #-}
diff --git a/hsfiles/postgres.hsfiles b/hsfiles/postgres.hsfiles
--- a/hsfiles/postgres.hsfiles
+++ b/hsfiles/postgres.hsfiles
@@ -101,6 +101,9 @@
     -- temporary foundation without a real connection pool, get a log function
     -- from there, and then create the real foundation.
     let mkFoundation appConnPool = App {..}
+        -- The App {..} syntax is an example of record wild cards. For more
+        -- information, see:
+        -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html
         tempFoundation = mkFoundation $ error "connPool forced in tempFoundation"
         logFunc = messageLoggerSource tempFoundation appLogger
 
@@ -1002,11 +1005,11 @@
 # skip-combining: false
 
 database:
-  user:     "_env:PGUSER:PROJECTNAME"
+  user:     "_env:PGUSER:PROJECTNAME_LOWER"
   password: "_env:PGPASS:PROJECTNAME"
   host:     "_env:PGHOST:localhost"
   port:     "_env:PGPORT:5432"
-  database: "_env:PGDATABASE:PROJECTNAME"
+  database: "_env:PGDATABASE:PROJECTNAME_LOWER"
   poolsize: "_env:PGPOOLSIZE:10"
 
 copyright: Insert copyright statement here
@@ -1014,7 +1017,7 @@
 
 {-# START_FILE config/test-settings.yml #-}
 database:
-  database: PROJECTNAME_test
+  database: PROJECTNAME_LOWER_test
 
 {-# START_FILE static/css/bootstrap.css #-}
 /*!
diff --git a/hsfiles/simple.hsfiles b/hsfiles/simple.hsfiles
--- a/hsfiles/simple.hsfiles
+++ b/hsfiles/simple.hsfiles
@@ -894,8 +894,7 @@
 #analytics: UA-YOURCODE
 
 {-# START_FILE config/test-settings.yml #-}
-database:
-  database: PROJECTNAME_test
+{}
 
 {-# START_FILE static/css/bootstrap.css #-}
 /*!
diff --git a/hsfiles/sqlite.hsfiles b/hsfiles/sqlite.hsfiles
--- a/hsfiles/sqlite.hsfiles
+++ b/hsfiles/sqlite.hsfiles
@@ -101,6 +101,9 @@
     -- temporary foundation without a real connection pool, get a log function
     -- from there, and then create the real foundation.
     let mkFoundation appConnPool = App {..}
+        -- The App {..} syntax is an example of record wild cards. For more
+        -- information, see:
+        -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html
         tempFoundation = mkFoundation $ error "connPool forced in tempFoundation"
         logFunc = messageLoggerSource tempFoundation appLogger
 
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.1
+version:         1.4.7.2
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -88,7 +88,7 @@
                      , wai-extra
                      , data-default-class
                      , streaming-commons
-                     , warp-tls
+                     , warp-tls           >= 3.0.1
                      , async
 
     ghc-options:       -Wall -threaded -rtsopts
