diff --git a/Haskintex.hs b/Haskintex.hs
--- a/Haskintex.hs
+++ b/Haskintex.hs
@@ -1,5 +1,5 @@
 
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
 
 module Haskintex (haskintex) where
 
@@ -26,7 +26,9 @@
 import Text.LaTeX.Base.Syntax
 -- Utils
 import Control.Applicative
+#if !MIN_VERSION_base(4,8,0)
 import Data.Foldable (foldMap)
+#endif
 import Numeric (showFFloat)
 -- Paths
 import Paths_haskintex (version)
diff --git a/haskintex.cabal b/haskintex.cabal
--- a/haskintex.cabal
+++ b/haskintex.cabal
@@ -1,5 +1,5 @@
 name:                haskintex
-version:             0.5.0.2
+version:             0.5.0.3
 synopsis:            Haskell Evaluation inside of LaTeX code.
 description:
   The /haskintex/ (Haskell in LaTeX) program is a tool that reads a LaTeX file and evaluates Haskell expressions contained
@@ -43,7 +43,7 @@
                , text >= 0.11.2.3 && < 2
                , bytestring >= 0.10.4
                , directory >= 1.2.0 && < 1.3
-               , filepath >= 1.1.0 && < 1.4
+               , filepath >= 1.1.0 && < 1.5
                , process >= 1.2.0
                , HaTeX >= 3.9.0.0
                , parsec >= 3.1.2
