diff --git a/CHANGES b/CHANGES
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,31 @@
+Version 0.12.1 released 17 Feb 2016
+
+  * Use fmap instead of <$> so ghc 7.8 won't fail.
+  * Allow latest hoauth2
+  * Fix typo (Chas Leichner).
+  * Allow compiling with pandoc 1.16.x.
+  * Add page for login failure when authorization is required for reading
+    (Phil Ruffwind).  When authorization is required to read the wiki, the
+    error message from a failed GitHub login cannot be displayed.  Instead it
+    will redirect to GitHub for another OAuth authentication, which can lead to
+    a redirect loop.  To avoid this, the user is now redirected to a special
+    landing page to display the login failure.  Note: no changes are made for
+    the case where authorization is not required to read the wiki.
+  * Improve error message of GitHub membership check (Phil Ruffwind).
+  * Add delete-summary config variable (Phil Ruffwind).
+    Used to change the commit message when a page is deleted.
+  * Use primary GitHub email rather than just the first (Phil Ruffwind).
+    The order in which user emails are returned via the GitHub API is not
+    specified, so the first may not be the one that the user prefers,
+    i.e. the so-called "primary" email.  To fix this problem, we eliminate
+    all emails except for the one marked as "primary".
+  * Make default theme responsive (Lincoln Mullen, #450).
+    This commit makes the default theme responsive. For smaller browsers, it
+    will move the sidebar below the main content div and make the sidebar
+    three columns. On phones, it will also collapse the sidebar into a
+    single column.
+  * README: Tell how to enable rtsopts for disabling GC (norpol).
+
 Version 0.12.0.1 released 24 Aug 2015
 
   * Revert change of curly to straight quote for starting
diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -464,6 +464,13 @@
 
     gitit -f my.conf +RTS -I0 -RTS
 
+
+Note:
+
+To enable RTS, cabal needs to pass the compile flag `-rtsopts` to GHC while installing.
+
+    cabal install --reinstall gitit --ghc-options="-rtsopts"
+
 Using gitit with apache
 =======================
 
diff --git a/data/default.conf b/data/default.conf
--- a/data/default.conf
+++ b/data/default.conf
@@ -136,6 +136,9 @@
 # (the default), the author will be required to fill in the description
 # field.
 
+delete-summary: Deleted using web interface.
+# specifies text to be used in the change description when a page is deleted
+
 table-of-contents: yes
 # specifies whether to print a tables of contents (with links to
 # sections) on each wiki page.
diff --git a/data/static/css/screen.css b/data/static/css/screen.css
--- a/data/static/css/screen.css
+++ b/data/static/css/screen.css
@@ -155,3 +155,40 @@
 }
 /* Deal with multiple footnotes one after another; Charuru */
 sup + sup { margin-left: 2px; }
+
+/* Make theme responsive */
+@media (max-width: 768px) {
+  #yui-main {
+    float:none!important;
+    margin-left: 0!important;
+  }
+  #maincol {
+    margin-left: 0!important;
+  }
+  #sidebar {
+    width: 100%;
+    float: none;
+  }
+  #logo {
+    float: left;
+    margin-right:5%;
+    margin-top: 12px;
+    width: 30%;
+  }
+  .sitenav {
+    float: left;
+    margin-right: 5%;
+    width: 30%;
+  }
+  .pageTools {
+    float: right;
+    width: 30%
+  }
+}
+@media (max-device-width: 568px) {
+  #logo, .sitenav, .pageTools {
+    float: none;
+    width: 100%;
+  }
+}
+
diff --git a/data/templates/page.st b/data/templates/page.st
--- a/data/templates/page.st
+++ b/data/templates/page.st
@@ -3,6 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
     $if(feed)$
     <link href="$base$/_feed/" type="application/atom+xml" rel="alternate" title="$wikititle$" />
     <link href="$base$/_feed$pageUrl$" type="application/atom+xml" rel="alternate" title="$wikititle$ - $pagetitle$" />
diff --git a/gitit.cabal b/gitit.cabal
--- a/gitit.cabal
+++ b/gitit.cabal
@@ -1,5 +1,5 @@
 name:                gitit
-version:             0.12.0.1
+version:             0.12.1
 Cabal-version:       >= 1.8
 build-type:          Simple
 synopsis:            Wiki using happstack, git or darcs, and pandoc.
@@ -139,18 +139,18 @@
                      directory,
                      mtl,
                      old-time,
-                     pandoc >= 1.12.4 && < 1.16,
-                     pandoc-types >= 1.12.3 && < 1.13,
+                     pandoc >= 1.12.4 && < 1.17,
+                     pandoc-types >= 1.12.3 && < 1.17,
                      highlighting-kate >= 0.5.0.1 && < 0.7,
                      bytestring,
                      text,
                      random,
                      utf8-string >= 0.3 && < 1.1,
                      SHA > 1 && < 1.7,
-                     HTTP >= 4000.0 && < 4000.3,
+                     HTTP >= 4000.0 && < 4000.4,
                      HStringTemplate >= 0.6 && < 0.9,
                      old-locale >= 1,
-                     time >= 1.1 && < 1.6,
+                     time >= 1.1 && < 1.7,
                      recaptcha >= 0.1,
                      filestore >= 0.6 && < 0.7,
                      zlib >= 0.5 && < 0.7,
@@ -167,10 +167,10 @@
                      json >= 0.4 && < 0.10,
                      uri >= 0.1 && < 0.2,
                      split,
-                     hoauth2 >= 0.4.2 && < 0.5,
+                     hoauth2 >= 0.4.2 && < 0.6,
                      http-conduit >= 2.1.4 && < 2.2,
                      http-client-tls >= 0.2.2 && < 0.3,
-                     aeson >= 0.7 && < 0.10,
+                     aeson >= 0.7 && < 0.11,
                      uuid >= 1.3 && < 1.4
   if impl(ghc >= 6.10)
     build-depends:   base >= 4, syb
diff --git a/src/Network/Gitit/Authentication.hs b/src/Network/Gitit/Authentication.hs
--- a/src/Network/Gitit/Authentication.hs
+++ b/src/Network/Gitit/Authentication.hs
@@ -317,7 +317,7 @@
   let errors = validate $ optionalTests validationType ++
         [ (not isValidAccessCode, "Incorrect response to access prompt.")
         , (not (isValidUsername uname),
-         "Username must be at least 3 charcaters, all letters or digits.")
+         "Username must be at least 3 characters, all letters or digits.")
         , (not (isValidPassword pword),
          "Password must be at least 6 characters, " ++
          "and must contain at least one non-letter.")
@@ -464,7 +464,11 @@
                      seeOther (encUrl destination) $ toResponse ()
           Left err -> do
               liftIO $ logM "gitit" WARNING $ "Login Failed: " ++ ghUserMessage err ++ maybe "" (". Github response" ++) (ghDetails err)
-              let url = destination ++ "?message=" ++ ghUserMessage err
+              cfg <- getConfig
+              let destination'
+                    | requireAuthentication cfg >= ForRead = base' ++ "/_loginFailure"
+                    | otherwise                            = destination
+              let url = destination' ++ "?message=" ++ ghUserMessage err
               seeOther (encUrl url) $ toResponse ()
 
 githubAuthHandlers :: GithubConfig
@@ -472,8 +476,20 @@
 githubAuthHandlers ghConfig =
   [ dir "_logout" $ withData logoutUser
   , dir "_login" $ loginGithubUser $ oAuth2 ghConfig
+  , dir "_loginFailure" $ githubLoginFailure
   , dir "_githubCallback" $ withData $ oauthGithubCallback ghConfig
   , dir "_user" currentUser ]
+
+githubLoginFailure :: Handler
+githubLoginFailure = withData $ \params ->
+  formattedPage (pageLayout (pMessages params)) noHtml >>= forbidden
+  where
+    pageLayout msgs =
+      defaultPageLayout{ pgShowPageTools = False,
+                         pgTabs = [],
+                         pgTitle = "Login failure",
+                         pgMessages = msgs
+                       }
 
 -- Login using RPX (see RPX development docs at https://rpxnow.com/docs)
 loginRPXUser :: RPars  -- ^ The parameters passed by the RPX callback call (after authentication has taken place
diff --git a/src/Network/Gitit/Authentication/Github.hs b/src/Network/Gitit/Authentication/Github.hs
--- a/src/Network/Gitit/Authentication/Github.hs
+++ b/src/Network/Gitit/Authentication/Github.hs
@@ -67,13 +67,13 @@
                             (\githubUserMail -> do
                                        let gitLogin = gLogin githubUser
                                        user <- mkUser (unpack gitLogin)
-                                                   (unpack $ email $ head githubUserMail)
+                                                   (unpack $ email $ head (filter primary githubUserMail))
                                                    "none"
                                        let mbOrg = org ghConfig
                                        case mbOrg of
                                              Nothing -> return $ Right user
                                              Just githuborg -> ifSuccess
-                                                      ("Membership check of user " ++ unpack gitLogin ++  " to "  ++ unpack githuborg ++ " failed")
+                                                      ("Membership check failed: the user " ++ unpack gitLogin ++  " is required to be a member of the organization "  ++ unpack githuborg ++ ".")
                                                       (orgInfo gitLogin githuborg mgr at)
                                                       (\_ -> return $ Right user))))
               else
@@ -117,11 +117,13 @@
     parseJSON _ = mzero
 
 data GithubUserMail = GithubUserMail { email :: Text
+                                     , primary :: Bool
                              } deriving (Show, Eq)
 
 instance FromJSON GithubUserMail where
     parseJSON (Object o) = GithubUserMail
                            <$> o .: "email"
+                           <*> o .: "primary"
     parseJSON _ = mzero
 
 sToBS :: String -> BS.ByteString
diff --git a/src/Network/Gitit/Config.hs b/src/Network/Gitit/Config.hs
--- a/src/Network/Gitit/Config.hs
+++ b/src/Network/Gitit/Config.hs
@@ -114,6 +114,7 @@
       cfNoEdit <- get cp "DEFAULT" "no-edit"
       cfNoDelete <- get cp "DEFAULT" "no-delete"
       cfDefaultSummary <- get cp "DEFAULT" "default-summary"
+      cfDeleteSummary <- get cp "DEFAULT" "delete-summary"
       cfAccessQuestion <- get cp "DEFAULT" "access-question"
       cfAccessQuestionAnswers <- get cp "DEFAULT" "access-question-answers"
       cfUseRecaptcha <- get cp "DEFAULT" "use-recaptcha"
@@ -209,6 +210,7 @@
         , noEdit               = splitCommaList cfNoEdit
         , noDelete             = splitCommaList cfNoDelete
         , defaultSummary       = cfDefaultSummary
+        , deleteSummary        = cfDeleteSummary
         , accessQuestion       = if null cfAccessQuestion
                                     then Nothing
                                     else Just (cfAccessQuestion, splitCommaList cfAccessQuestionAnswers)
diff --git a/src/Network/Gitit/ContentTransformer.hs b/src/Network/Gitit/ContentTransformer.hs
--- a/src/Network/Gitit/ContentTransformer.hs
+++ b/src/Network/Gitit/ContentTransformer.hs
@@ -719,10 +719,17 @@
 
 -- | Convert links with no URL to wikilinks.
 convertWikiLinks :: Config -> Inline -> Inline
+#if MIN_VERSION_pandoc(1,16,0)
+convertWikiLinks cfg (Link attr ref ("", "")) | useAbsoluteUrls cfg =
+  Link attr ref ("/" </> baseUrl cfg </> inlinesToURL ref, "Go to wiki page")
+convertWikiLinks _cfg (Link attr ref ("", "")) =
+  Link attr ref (inlinesToURL ref, "Go to wiki page")
+#else
 convertWikiLinks cfg (Link ref ("", "")) | useAbsoluteUrls cfg =
   Link ref ("/" </> baseUrl cfg </> inlinesToURL ref, "Go to wiki page")
 convertWikiLinks _cfg (Link ref ("", "")) =
   Link ref (inlinesToURL ref, "Go to wiki page")
+#endif
 convertWikiLinks _cfg x = x
 
 -- | Derives a URL from a list of Pandoc Inline elements.
@@ -745,13 +752,21 @@
                Cite _ xs               -> concatMap go xs
                Code _ s                -> s
                Space                   -> " "
+#if MIN_VERSION_pandoc(1,16,0)
+               SoftBreak               -> " "
+#endif
                LineBreak               -> " "
                Math DisplayMath s      -> "$$" ++ s ++ "$$"
                Math InlineMath s       -> "$" ++ s ++ "$"
                RawInline (Format "tex") s -> s
                RawInline _ _           -> ""
+#if MIN_VERSION_pandoc(1,16,0)
+               Link _ xs _             -> concatMap go xs
+               Image _ xs _            -> concatMap go xs
+#else
                Link xs _               -> concatMap go xs
                Image xs _              -> concatMap go xs
+#endif
                Note _                  -> ""
                Span _ xs               -> concatMap go xs
 
diff --git a/src/Network/Gitit/Export.hs b/src/Network/Gitit/Export.hs
--- a/src/Network/Gitit/Export.hs
+++ b/src/Network/Gitit/Export.hs
@@ -26,6 +26,7 @@
 import Text.Pandoc.PDF (makePDF)
 import Text.Pandoc.SelfContained as SelfContained
 import Text.Pandoc.Shared (readDataFileUTF8)
+import qualified Text.Pandoc.UTF8 as UTF8
 import Network.Gitit.Server
 import Network.Gitit.Framework (pathForPage, getWikiBase)
 import Network.Gitit.State (getConfig)
@@ -36,7 +37,6 @@
 import Text.XHtml (noHtml)
 import qualified Data.ByteString as B
 import qualified Data.ByteString.Lazy as L
-import Data.ByteString.Lazy.UTF8 (fromString, toString)
 import System.FilePath ((</>), takeDirectory)
 import Control.Exception (throwIO)
 import System.Directory (doesFileExist)
@@ -80,7 +80,7 @@
 respondS :: String -> String -> String -> (WriterOptions -> Pandoc -> String)
           -> WriterOptions -> String -> Pandoc -> Handler
 respondS templ mimetype ext fn =
-  respondX templ mimetype ext (\o d -> return $ fromString $ fn o d)
+  respondX templ mimetype ext (\o d -> return $ UTF8.fromStringLazy $ fn o d)
 
 respondSlides :: String -> HTMLSlideVariant -> String -> Pandoc -> Handler
 respondSlides templ slideVariant page doc = do
@@ -139,7 +139,7 @@
 #endif
     ok . setContentType "text/html;charset=UTF-8" .
       -- (setFilename (page ++ ".html")) .
-      toResponseBS B.empty $ fromString h'
+      toResponseBS B.empty $ UTF8.fromStringLazy h'
 
 respondLaTeX :: String -> Pandoc -> Handler
 respondLaTeX = respondS "latex" "application/x-latex" "tex"
@@ -152,7 +152,7 @@
 
 respondRTF :: String -> Pandoc -> Handler
 respondRTF = respondX "rtf" "application/rtf" "rtf"
-  (\o d -> fromString `fmap` writeRTFWithEmbeddedImages o d) defaultRespOptions
+  (\o d -> UTF8.fromStringLazy `fmap` writeRTFWithEmbeddedImages o d) defaultRespOptions
 
 respondRST :: String -> Pandoc -> Handler
 respondRST = respondS "rst" "text/plain; charset=utf-8" ""
@@ -188,9 +188,15 @@
 respondOrg = respondS "org" "text/plain; charset=utf-8" ""
   writeOrg defaultRespOptions
 
+#if MIN_VERSION_pandoc(1,16,0)
 respondICML :: String -> Pandoc -> Handler
+respondICML = respondX "icml" "application/xml; charset=utf-8" ""
+              (\o d -> fmap UTF8.fromStringLazy $ writeICML o d)
+                         defaultRespOptions
+#else
 respondICML = respondS "icml" "application/xml; charset=utf-8" ""
-  writeICML defaultRespOptions
+              writeICML defaultRespOptions
+#endif
 
 respondTextile :: String -> Pandoc -> Handler
 respondTextile = respondS "textile" "text/plain; charset=utf-8" ""
@@ -240,7 +246,7 @@
               return res
   case pdf' of
        Left logOutput -> simpleErrorHandler ("PDF creation failed:\n"
-                           ++ toString logOutput)
+                           ++ UTF8.toStringLazy logOutput)
        Right pdfBS -> do
               case cached of
                 Nothing ->
@@ -264,9 +270,15 @@
     let static = staticDir cfg
     let repoPath = repositoryPath cfg
 
+#if MIN_VERSION_pandoc(1,16,0)
+    let go (Image attr ils (url, title)) = do
+           fixedURL <- fixURL url
+           return $ Image attr ils (fixedURL, title)
+#else
     let go (Image ils (url, title)) = do
            fixedURL <- fixURL url
            return $ Image ils (fixedURL, title)
+#endif
         go x                        = return x
 
         fixURL ('/':url) = resolve url
diff --git a/src/Network/Gitit/Feed.hs b/src/Network/Gitit/Feed.hs
--- a/src/Network/Gitit/Feed.hs
+++ b/src/Network/Gitit/Feed.hs
@@ -140,8 +140,8 @@
 
 enTag :: String -> [Content] -> Content
 enTag tag content = Elem blank_element{ elName=blank_name{qName=tag}
-				      , elContent=content
-				      }
+                                      , elContent=content
+                                      }
 enTag1 :: String -> Content -> Content
 enTag1 tag content = enTag tag [content]
 enText :: String -> Content
diff --git a/src/Network/Gitit/Handlers.hs b/src/Network/Gitit/Handlers.hs
--- a/src/Network/Gitit/Handlers.hs
+++ b/src/Network/Gitit/Handlers.hs
@@ -608,7 +608,7 @@
                         Nothing -> return ("Anonymous", "")
                         Just u  -> return (uUsername u, uEmail u)
   let author = Author user email
-  let descrip = "Deleted using web interface."
+  let descrip = deleteSummary cfg
   base' <- getWikiBase
   if pConfirm params && (file == page || file == page <.> (defaultExtension cfg))
      then do
diff --git a/src/Network/Gitit/Types.hs b/src/Network/Gitit/Types.hs
--- a/src/Network/Gitit/Types.hs
+++ b/src/Network/Gitit/Types.hs
@@ -159,6 +159,8 @@
   noDelete             :: [String],
   -- | Default summary if description left blank
   defaultSummary       :: String,
+  -- | Delete summary
+  deleteSummary        :: String,
   -- | @Nothing@ = anyone can register.
   -- @Just (prompt, answers)@ = a user will
   -- be given the prompt and must give
