diff --git a/simple.cabal b/simple.cabal
--- a/simple.cabal
+++ b/simple.cabal
@@ -1,5 +1,5 @@
 name:                simple
-version:             1.0.0
+version:             2.0.0
 synopsis: A minimalist web framework for the WAI server interface
 description:
 
@@ -52,7 +52,7 @@
     , filepath
     , process
     , setenv
-    , simple-templates >= 1.0.0
+    , simple-templates >= 2.0.0
     , text
     , unordered-containers
     , vector
diff --git a/src/Web/Simple/Controller/Trans.hs b/src/Web/Simple/Controller/Trans.hs
--- a/src/Web/Simple/Controller/Trans.hs
+++ b/src/Web/Simple/Controller/Trans.hs
@@ -60,11 +60,11 @@
                               Right result -> (Right $ f result, st)
 
 instance (Monad m, Functor m) => Applicative (ControllerT s m) where
-  pure = return
+  pure a = ControllerT $ \st _ -> return $ (Right a, st)
   (<*>) = ap
 
 instance Monad m => Monad (ControllerT s m) where
-  return a = ControllerT $ \st _ -> return $ (Right a, st)
+  return = pure
   (ControllerT act) >>= fn = ControllerT $ \st0 req -> do
     (eres, st) <- act st0 req
     case eres of
diff --git a/src/Web/Simple/Templates.hs b/src/Web/Simple/Templates.hs
--- a/src/Web/Simple/Templates.hs
+++ b/src/Web/Simple/Templates.hs
@@ -10,6 +10,7 @@
 
 import Control.Monad.IO.Class
 import Data.Aeson
+import qualified Data.Aeson.KeyMap as K
 import qualified Data.ByteString as S
 import qualified Data.ByteString.Lazy as L
 import qualified Data.HashMap.Strict as H
@@ -135,14 +136,14 @@
 
 valueLength :: Value -> Value
 valueLength (Array arr) = toJSON $ V.length arr
-valueLength (Object obj) = toJSON $ H.size obj
+valueLength (Object obj) = toJSON $ K.size obj
 valueLength (String str) = toJSON $ T.length str
 valueLength Null = toJSON (0 :: Int)
 valueLength _ = error "length only valid for arrays, objects and strings"
 
 valueNull :: Value -> Value
 valueNull (Array arr) = toJSON $ V.null arr
-valueNull (Object obj) = toJSON $ H.null obj
+valueNull (Object obj) = toJSON $ K.null obj
 valueNull (String str) = toJSON $ T.null str
 valueNull Null = toJSON True
 valueNull _ = error "null only valid for arrays, objects and strings"
