diff --git a/buildwrapper.cabal b/buildwrapper.cabal
--- a/buildwrapper.cabal
+++ b/buildwrapper.cabal
@@ -1,5 +1,5 @@
 name:           buildwrapper
-version:        0.7.4
+version:        0.7.5
 cabal-version:  >= 1.8
 build-type:     Simple
 license:        BSD3
@@ -32,7 +32,7 @@
                    text,
                    containers,
                    vector >= 0.8,
-                   haskell-src-exts,
+                   haskell-src-exts >= 1.12 && <1.15,
                    cpphs,
                    old-time,
                    aeson >=0.4,
@@ -71,7 +71,7 @@
                    mtl,
                    ghc,
                    cpphs,
-                   haskell-src-exts,
+                   haskell-src-exts >= 1.12 && <1.15,
                    old-time,
                    ghc-paths,
                    vector >= 0.8,
diff --git a/src/Language/Haskell/BuildWrapper/GHC.hs b/src/Language/Haskell/BuildWrapper/GHC.hs
--- a/src/Language/Haskell/BuildWrapper/GHC.hs
+++ b/src/Language/Haskell/BuildWrapper/GHC.hs
@@ -1360,7 +1360,7 @@
                         szQualified2=if ideclQualified imp then 10 else szQualified
                         szPkg2=maybe szPkg (\p->max szPkg (3 + lengthFS p)) $ ideclPkgQual imp
                         L _ mo=ideclName imp
-                        szName2=max szName (1 + lengthFS (moduleNameFS mo))
+                        szName2=maybe szName (\_->max szName (1 + lengthFS (moduleNameFS mo))) $ ideclAs imp
                         szAs2=maybe szAs (\m->max szAs (3 + lengthFS (moduleNameFS m))) $ ideclAs imp
                         in (szSafe2,szQualified2,szPkg2,szName2,szAs2)
                 formatImport :: (Int,Int,Int,Int,Int)-> FinalImportValue -> ImportClean
diff --git a/src/Language/Haskell/BuildWrapper/Src.hs b/src/Language/Haskell/BuildWrapper/Src.hs
--- a/src/Language/Haskell/BuildWrapper/Src.hs
+++ b/src/Language/Haskell/BuildWrapper/Src.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeSynonymInstances,OverloadedStrings #-}
+{-# LANGUAGE TypeSynonymInstances,OverloadedStrings,CPP #-}
 -- |
 -- Module      : Language.Haskell.BuildWrapper.Src
 -- Copyright   : (c) JP Moresmau 2011
@@ -38,7 +38,11 @@
                            _               -> []
             optionsPragmas = [ optionsPragma | S.OptionsPragma _ _ optionsPragma <- topPragmas ]
             optionsFromPragmas = concatMap words optionsPragmas
+#if MIN_VERSION_haskell_src_exts(1,14,0)   
+            exts=EnableExtension MultiParamTypeClasses : EnableExtension PatternGuards : (map (\x->classifyExtension $ if "-X" `isPrefixOf` x then tail $ tail x else x) $ options ++ optionsFromPragmas)
+#else
             exts=MultiParamTypeClasses : PatternGuards : (map (\x->classifyExtension $ if "-X" `isPrefixOf` x then tail $ tail x else x) $ options ++ optionsFromPragmas)
+#endif
             extsFull=if "-fglasgow-exts" `elem` options ++ optionsFromPragmas
                 then exts ++ glasgowExts
                 else exts 
diff --git a/test/Language/Haskell/BuildWrapper/ImportsTests.hs b/test/Language/Haskell/BuildWrapper/ImportsTests.hs
--- a/test/Language/Haskell/BuildWrapper/ImportsTests.hs
+++ b/test/Language/Haskell/BuildWrapper/ImportsTests.hs
@@ -303,7 +303,7 @@
         (ics,ns)<-cleanImports api root rel True
         assertBool $ null ns
         assertEqual [ImportClean (InFileSpan (InFileLoc 3 1) (InFileLoc 3 23)) 
-                        "import System.FilePath  ((</>))"
+                        "import System.FilePath ((</>))"
                 ] 
                 ics   
                 
