diff --git a/atp-haskell.cabal b/atp-haskell.cabal
--- a/atp-haskell.cabal
+++ b/atp-haskell.cabal
@@ -1,5 +1,5 @@
 Name:             atp-haskell
-Version:          1.14.1
+Version:          1.14.2
 Synopsis:         Translation from Ocaml to Haskell of John Harrison's ATP code
 Description:      This package is a liberal translation from OCaml to Haskell of
                   the automated theorem prover written in OCaml in
@@ -34,7 +34,7 @@
     pretty >= 1.1.2,
     template-haskell,
     time
-  GHC-options: -Wall -O2
+  GHC-options: -Wall
   Hs-Source-Dirs: src
   Exposed-Modules:
     Data.Logic.ATP
diff --git a/src/Data/Logic/ATP/Lib.hs b/src/Data/Logic/ATP/Lib.hs
--- a/src/Data/Logic/ATP/Lib.hs
+++ b/src/Data/Logic/ATP/Lib.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
@@ -56,6 +57,9 @@
 
 import Control.Applicative.Error (Failing(..))
 import Control.Concurrent (forkIO, killThread, newEmptyMVar, putMVar, takeMVar, threadDelay)
+#if MIN_VERSION_base(4,9,0)
+import qualified Control.Monad.Fail as Fail
+#endif
 import Control.Monad.RWS (evalRWS, runRWS, RWS)
 import Data.Data (Data)
 import Data.Foldable as Foldable
@@ -92,7 +96,14 @@
       case m of
         (Failure errs) -> (Failure errs)
         (Success a) -> f a
+#if !MIN_VERSION_base(4,13,0)
   fail errMsg = Failure [errMsg]
+#endif
+
+#if MIN_VERSION_base(4,9,0)
+instance Fail.MonadFail Failing where
+  fail errMsg = Failure [errMsg]
+#endif
 
 deriving instance Typeable Failing
 deriving instance Data a => Data (Failing a)
diff --git a/src/Data/Logic/ATP/Term.hs b/src/Data/Logic/ATP/Term.hs
--- a/src/Data/Logic/ATP/Term.hs
+++ b/src/Data/Logic/ATP/Term.hs
@@ -12,6 +12,7 @@
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeOperators #-}
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE UndecidableInstances #-}
 
