diff --git a/Network/TLS/Struct.hs b/Network/TLS/Struct.hs
--- a/Network/TLS/Struct.hs
+++ b/Network/TLS/Struct.hs
@@ -60,6 +60,10 @@
 import Control.Exception (Exception(..))
 import Network.TLS.Types
 import Network.TLS.Crypto.DH
+#if MIN_VERSION_mtl(2,2,1)
+#else
+import Control.Monad.Error
+#endif
 
 type Bytes = ByteString
 
diff --git a/tls.cabal b/tls.cabal
--- a/tls.cabal
+++ b/tls.cabal
@@ -1,5 +1,5 @@
 Name:                tls
-Version:             1.2.12
+Version:             1.2.13
 Description:
    Native Haskell TLS and SSL protocol implementation for server and client.
    .
