diff --git a/data/prefscoll.lkshp b/data/prefscoll.lkshp
--- a/data/prefscoll.lkshp
+++ b/data/prefscoll.lkshp
@@ -1,7 +1,7 @@
 Paths under which haskell sources for packages may be found:
                []
 Maybe a directory for unpacking cabal packages:
-               Just "~/.leksah-0.12/packageSources"
+               Just "~/.leksah-0.13/packageSources"
 An URL to load prebuild metadata:
                "http://www.leksah.org"
 A strategy for downloading prebuild metadata:
diff --git a/leksah-server.cabal b/leksah-server.cabal
--- a/leksah-server.cabal
+++ b/leksah-server.cabal
@@ -1,5 +1,5 @@
 name: leksah-server
-version: 0.13.1.0
+version: 0.13.1.1
 cabal-version: >= 1.10.2
 build-type: Simple
 license: GPL
@@ -15,7 +15,7 @@
 category: IDE
 author: Juergen "jutaro" Nicklisch-Franken, Hamish Mackenzie
 data-dir: ""
-tested-with: GHC ==6.10 || ==6.12 || ==7.0
+tested-with: GHC ==7.4 || ==7.6 || ==7.8
 data-files:
             data/prefscoll.lkshp
 flag curl
@@ -32,10 +32,10 @@
 
 library
     default-language: Haskell98
-    build-depends: Cabal >=1.6.0.1 && <1.20, base >= 4.0.0.0 && <4.8, binary >=0.5.0.0 && <0.8,
+    build-depends: Cabal >=1.10.2.0 && <1.22, base >= 4.0.0.0 && <4.8, binary >=0.5.0.0 && <0.8,
                binary-shared >=0.8 && <0.9, bytestring >=0.9.0.1 && <0.11,
                containers >=0.2.0.0 && <0.6, executable-path >=0.0.3 && <0.1,
-               directory >=1.0.0.2 && <1.3, filepath >=1.1.0.1 && <1.4, ghc >=6.10.1 && <7.9,
+               directory >=1.0.0.2 && <1.3, filepath >=1.1.0.1 && <1.4, ghc >=7.0.4 && <7.9,
                ltk >=0.13.1.0 && <0.14, parsec >=2.1.0.1 && <3.2,
                pretty >=1.0.1.0 && <1.2, time >=1.1 && <1.5, deepseq >=1.1 && <1.4,
                hslogger >= 1.0.7 && <1.3, network >=2.2 && <3.0, conduit >= 1.0.8 && <1.1,
@@ -56,13 +56,7 @@
          if (impl(ghc >= 7.2))
             build-depends: haddock >= 2.7.2 && <2.10
          else
-            if (impl(ghc >= 7.0))
-               build-depends: haddock >= 2.7.2 && <2.9.3
-            else
-               if (impl(ghc >= 6.12))
-                  build-depends: haddock >= 2.7.2 && <2.9
-               else
-                  build-depends: haddock-leksah == 2.5.0
+            build-depends: haddock >= 2.7.2 && <2.9.3
 
     if (impl(ghc >= 7.2))
        build-depends: process >= 1.1 && <1.3
@@ -101,10 +95,10 @@
 
 executable leksah-server
     default-language: Haskell98
-    build-depends: Cabal >=1.6.0.1 && <1.19, base >= 4.0.0.0 && <4.8, binary >=0.5.0.0 && <0.8,
+    build-depends: Cabal >=1.10.2.0 && <1.22, base >= 4.0.0.0 && <4.8, binary >=0.5.0.0 && <0.8,
                binary-shared >=0.8 && <0.9, bytestring >=0.9.0.1 && <0.11,
                containers >=0.2.0.0 && <0.6, executable-path >=0.0.3 && <0.1,
-               directory >=1.0.0.2 && <1.3, filepath >=1.1.0.1 && <1.6, ghc >=6.10.1 && <7.9,
+               directory >=1.0.0.2 && <1.3, filepath >=1.1.0.1 && <1.6, ghc >=7.0.4 && <7.9,
                ltk >=0.13.1.0 && <0.14, parsec >=2.1.0.1 && <3.2,
                pretty >=1.0.1.0 && <1.2, time >=1.1 && <1.5, deepseq >=1.1 && <1.4,
                hslogger >= 1.0.7 && <1.3, network >=2.2 && <3.0, conduit >= 1.0.8 && <1.1,
@@ -125,13 +119,7 @@
          if (impl(ghc >= 7.2))
             build-depends: haddock >= 2.7.2 && <2.10
          else
-            if (impl(ghc >= 7.0))
-               build-depends: haddock >= 2.7.2 && <2.9.3
-            else
-               if (impl(ghc >= 6.12))
-                  build-depends: haddock >= 2.7.2 && <2.9
-               else
-                  build-depends: haddock-leksah == 2.5.0
+            build-depends: haddock >= 2.7.2 && <2.9.3
 
     if (impl(ghc >= 7.2))
        build-depends: process >= 1.1 && <1.3
@@ -208,7 +196,7 @@
     hs-source-dirs: tests
     main-is:    TestTool.hs
     build-depends: base >= 4.0.0.0 && <4.8,  hslogger >= 1.0.7 && <1.3,
-               leksah-server == 0.13.1.0,
+               leksah-server == 0.13.1.1,
                HUnit >=1.2 && <1.3, transformers >=0.2.2.0 && <0.4, conduit >= 1.0.8 && <1.1
 
     if (impl(ghc >= 7.2))
diff --git a/src/IDE/Core/CTypes.hs b/src/IDE/Core/CTypes.hs
--- a/src/IDE/Core/CTypes.hs
+++ b/src/IDE/Core/CTypes.hs
@@ -63,27 +63,35 @@
 
 ) where
 
-import Data.Typeable (Typeable(..))
+import Data.Typeable (Typeable)
 import Data.Map (Map)
 import Data.Set (Set)
 import Default (Default(..))
 import MyMissing (nonEmptyLines)
+#if MIN_VERSION_ghc(7,6,0)
 import Distribution.Package
-       (PackageName(..), PackageIdentifier(..))
+       (PackageIdentifier(..))
+#else
+import Distribution.Package
+       (PackageIdentifier(..),PackageName(..))
+#endif
 import Distribution.ModuleName (components, ModuleName)
 import Data.ByteString.Char8 (ByteString)
+#if !MIN_VERSION_bytestring(0,10,0)
+import Data.Version (Version(..))
+#endif
 import Distribution.Text (simpleParse, display)
-import qualified Data.ByteString.Char8 as  BS (unpack, empty)
-import qualified Data.Map as Map (lookup,keysSet,splitLookup, insertWith,empty,elems,union,toList)
-import qualified Data.Set as Set (toList)
+import qualified Data.ByteString.Char8 as BS (unpack, empty)
+import qualified Data.Map as Map (lookup,keysSet,splitLookup, insertWith,empty,elems,union)
 import Text.PrettyPrint as PP
 import Text.PrinterParser
 import Data.Char (isAlpha)
 import Control.DeepSeq (NFData(..))
-import qualified Data.ByteString.Char8 as BS (ByteString)
-import Data.Version (Version(..))
 import PackageConfig (PackageConfig)
 import qualified Distribution.InstalledPackageInfo as IPI
+#if !MIN_VERSION_ghc(7,7,0)
+import Distribution.Package(PackageName(..))
+#endif
 
 -- ---------------------------------------------------------------------
 --  | Information about the system, extraced from .hi and source files
@@ -97,11 +105,7 @@
 metadataVersion = 7
 
 getThisPackage :: PackageConfig -> PackageIdentifier
-#if MIN_VERSION_Cabal(1,8,0)
 getThisPackage    =   IPI.sourcePackageId
-#else
-getThisPackage    =   IPI.package
-#endif
 
 data RetrieveStrategy = RetrieveThenBuild | BuildThenRetrieve | NeverRetrieve
     deriving (Show, Read, Eq, Ord, Enum, Bounded)
@@ -410,26 +414,27 @@
     }
   deriving (Eq,Ord,Read,Show)
 
-instance Pretty ImportDecl where
-	pretty (ImportDecl _ mod' qual _ _ mbName mbSpecs) =
-		mySep [text "import",
-		       if qual then text "qualified" else empty,
-		       pretty mod',
-		       maybePP (\m' -> text "as" <+> pretty m') mbName,
-		       maybePP exports mbSpecs]
-	    where
-		exports (ImportSpecList b specList) =
-			if b then text "hiding" <+> specs else specs
-		    where specs = parenList . map pretty $ specList
-		
+instance Pretty ImportDecl
+  where
+    pretty (ImportDecl _ mod' qual _ _ mbName mbSpecs) =
+        mySep [text "import",
+               if qual then text "qualified" else empty,
+               pretty mod',
+               maybePP (\m' -> text "as" <+> pretty m') mbName,
+               maybePP exports mbSpecs]
+      where
+        exports (ImportSpecList b specList) =
+            if b then text "hiding" <+> specs else specs
+                where specs = parenList . map pretty $ specList
+
 parenList :: [Doc] -> Doc
-parenList = PP.parens . fsep . PP.punctuate PP.comma		
-		
+parenList = PP.parens . fsep . PP.punctuate PP.comma
+
 mySep :: [Doc] -> Doc
 mySep [x]    = x
 mySep (x:xs) = x <+> fsep xs
-mySep []     = error "Internal error: mySep"		
-		
+mySep []     = error "Internal error: mySep"
+
 -- | An explicit import specification list.
 data ImportSpecList
     = ImportSpecList Bool [ImportSpec]
@@ -455,12 +460,12 @@
 newtype VName = VName String
 
 instance Pretty ImportSpec where
-	pretty (IVar name)                = pretty (VName name)
-	pretty (IAbs name)                = pretty name
-	pretty (IThingAll name)           = pretty name <> text "(..)"
-	pretty (IThingWith name nameList) =
-		pretty name <> (parenList (map (pretty.VName) nameList))
-		
+    pretty (IVar name)                = pretty (VName name)
+    pretty (IAbs name)                = pretty name
+    pretty (IThingAll name)           = pretty name <> text "(..)"
+    pretty (IThingWith name nameList) =
+    	pretty name <> (parenList (map (pretty.VName) nameList))
+    	
 instance Pretty VName  where
     pretty (VName str) = if isOperator str then PP.parens (PP.text str) else (PP.text str)
 
@@ -471,7 +476,7 @@
 isOperator (':':c:_) =  not (isAlpha c)    -- Don't treat :T as an operator
 isOperator ('_':_)   =  False              -- Not an operator
 isOperator (c:_)     =  not (isAlpha c)    -- Starts with non-alpha
-isOperator _         =  False		
+isOperator _         =  False    	
 
 -- ---------------------------------------------------------------------
 -- NFData instances for forcing evaluation
@@ -545,7 +550,7 @@
 instance NFData DescrType where  rnf a = seq a ()
 
 #if !MIN_VERSION_bytestring(0,10,0)
-instance NFData BS.ByteString where  rnf b = seq b ()
+instance NFData ByteString where  rnf b = seq b ()
 #endif
 
 #if !MIN_VERSION_deepseq(1,3,0)
diff --git a/src/IDE/Core/Serializable.hs b/src/IDE/Core/Serializable.hs
--- a/src/IDE/Core/Serializable.hs
+++ b/src/IDE/Core/Serializable.hs
@@ -27,12 +27,12 @@
 import Control.Monad (liftM)
 import Data.Maybe (fromJust)
 import Data.Binary.Shared (BinaryShared(..))
-import Data.Typeable (Typeable(..))
 import Distribution.Package (PackageName(..),PackageIdentifier(..))
 import Data.Version (Version(..))
 import Distribution.ModuleName (ModuleName)
 
 import IDE.Core.CTypes
+import Data.Typeable (Typeable)
 
 #if !MIN_VERSION_ghc(7,7,0)
 deriving instance Typeable PackageIdentifier
diff --git a/src/IDE/HeaderParser.hs b/src/IDE/HeaderParser.hs
--- a/src/IDE/HeaderParser.hs
+++ b/src/IDE/HeaderParser.hs
@@ -111,11 +111,11 @@
 srcSpanToLocation _ = error "srcSpanToLocation: unhelpful span"
 
 srcSpanStartLine' :: SrcSpan -> Int
-srcSpanStartLine' (RealSrcSpan span) = srcSpanStartLine span
+srcSpanStartLine' (RealSrcSpan span') = srcSpanStartLine span'
 srcSpanStartLine' _ = error "srcSpanStartLine': unhelpful span"
 
 srcSpanEndLine' :: SrcSpan -> Int
-srcSpanEndLine' (RealSrcSpan span) = srcSpanEndLine span
+srcSpanEndLine' (RealSrcSpan span') = srcSpanEndLine span'
 srcSpanEndLine' _ = error "srcSpanEndLine': unhelpful span"
 #else
 srcSpanToLocation :: SrcSpan -> Location
diff --git a/src/IDE/Metainfo/Collector.hs b/src/IDE/Metainfo/Collector.hs
--- a/src/IDE/Metainfo/Collector.hs
+++ b/src/IDE/Metainfo/Collector.hs
@@ -29,7 +29,10 @@
 import IDE.StrippedPrefs
 import IDE.Metainfo.WorkspaceCollector
 import Data.Maybe(catMaybes, fromJust, mapMaybe, isJust)
+#if MIN_VERSION_ghc(7,8,0)
+#else
 import Prelude hiding(catch)
+#endif
 import Control.Monad (liftM)
 import qualified Data.Set as Set (member)
 import IDE.Core.CTypes hiding (Extension)
diff --git a/src/IDE/Metainfo/InterfaceCollector.hs b/src/IDE/Metainfo/InterfaceCollector.hs
--- a/src/IDE/Metainfo/InterfaceCollector.hs
+++ b/src/IDE/Metainfo/InterfaceCollector.hs
@@ -86,11 +86,7 @@
     hiddenIfaceInfos    <-  getIFaceInfos (getThisPackage packageConfig)
                                             (IPI.hiddenModules packageConfig) session
     let pd = extractInfo dflags exportedIfaceInfos hiddenIfaceInfos (getThisPackage packageConfig)
-#if MIN_VERSION_Cabal(1,8,0)
                                             [] -- TODO 6.12 (IPI.depends $ packageConfigToInstalledPackageInfo packageConfig))
-#else
-				            (depends packageConfig)
-#endif
     deepseq pd (return pd)
 
 
@@ -194,17 +190,8 @@
                 ,   dscExported'       =   True
                 }
         in case decl of
-#if MIN_VERSION_Cabal(1,8,0)
-            (IfaceId _ _ _ _)
-#else
-            (IfaceId _ _ _)
-#endif
-                -> map Real [descr]
-#if MIN_VERSION_Cabal(1,11,0)
+            (IfaceId {}) -> map Real [descr]
             (IfaceData {ifName=name, ifCons=ifCons'})
-#else
-            (IfaceData name _ _ ifCons' _ _ _ _)
-#endif
                 -> let d = case ifCons' of
                             IfDataTyCon _decls
                                 ->  let
@@ -253,6 +240,10 @@
 #endif
             (IfaceForeign {})
                         ->  [Real $ descr]
+#if MIN_VERSION_ghc(7,8,0)
+            (IfacePatSyn {})
+                        ->  [Real $ descr]
+#endif
 
 extractConstructors :: DynFlags -> OccName -> [IfaceConDecl] -> [SimpleDescr]
 extractConstructors dflags name decls = map (\decl -> SimpleDescr (unpackFS $occNameFS (ifConOcc decl))
@@ -282,10 +273,10 @@
 extractType dflags it = Just ((BS.pack . filterExtras . showSDocUnqual dflags . ppr) it)
 
 extractFieldNames :: OccName -> String
-extractFieldNames occName = unpackFS $occNameFS occName
+extractFieldNames occName' = unpackFS $occNameFS occName'
 
 extractClassOp :: DynFlags -> IfaceClassOp -> SimpleDescr
-extractClassOp dflags (IfaceClassOp occName _dm ty) = SimpleDescr (unpackFS $occNameFS occName)
+extractClassOp dflags (IfaceClassOp occName' _dm ty) = SimpleDescr (unpackFS $occNameFS occName')
                                                 (Just (BS.pack $ showSDocUnqual dflags (ppr ty)))
                                                 Nothing Nothing True
 
@@ -323,18 +314,10 @@
 
 
 extractUsages :: DynFlags -> Usage -> Maybe (ModuleName, Set String)
-#if MIN_VERSION_Cabal(1,11,0)
-extractUsages _ (UsagePackageModule usg_mod' _ _) =
-#else
-extractUsages _ (UsagePackageModule usg_mod' _ ) =
-#endif
+extractUsages _ (UsagePackageModule {usg_mod = usg_mod'}) =
     let name    =   (fromJust . simpleParse . moduleNameString) (moduleName usg_mod')
     in Just (name, Set.fromList [])
-#if MIN_VERSION_Cabal(1,11,0)
-extractUsages dflags (UsageHomeModule usg_mod_name' _ usg_entities' _ _) =
-#else
-extractUsages dflags (UsageHomeModule usg_mod_name' _ usg_entities' _) =
-#endif
+extractUsages dflags (UsageHomeModule {usg_mod_name = usg_mod_name', usg_entities = usg_entities'}) =
     let name    =   (fromJust . simpleParse . moduleNameString) usg_mod_name'
         ids     =   map (showSDocUnqual dflags . ppr . fst) usg_entities'
     in Just (name, Set.fromList ids)
diff --git a/src/IDE/Metainfo/PackageCollector.hs b/src/IDE/Metainfo/PackageCollector.hs
--- a/src/IDE/Metainfo/PackageCollector.hs
+++ b/src/IDE/Metainfo/PackageCollector.hs
@@ -42,7 +42,7 @@
        (fromListWith, fromList, keys, lookup)
 import Data.List (delete, nub)
 import Distribution.Text (display)
-import Control.Exception (SomeException,catch)
+import Control.Exception (SomeException)
 #if defined(USE_LIBCURL)
 import Network.Curl (curlGetString_, CurlCode(..))
 import Control.Monad (when)
diff --git a/src/IDE/Metainfo/SourceCollectorH.hs b/src/IDE/Metainfo/SourceCollectorH.hs
--- a/src/IDE/Metainfo/SourceCollectorH.hs
+++ b/src/IDE/Metainfo/SourceCollectorH.hs
@@ -54,7 +54,6 @@
        (srcSpanToLocation, uncommentDecl, uncommentData, sortByLoc)
 #endif
 
-import Name (getOccString,getSrcSpan)
 import PackageConfig (PackageConfig)
 import Distribution.Verbosity (verbose)
 import qualified Distribution.InstalledPackageInfo as IPI
@@ -213,7 +212,7 @@
         transformToDescrs dflags pm exportedDeclInfo ++ map (toDescrInst dflags pm) ifaceInstances'
     where
         exportedDeclInfo                               =  mapMaybe toDeclInfo  ifaceExportItems'
-        toDeclInfo (ExportDecl decl mbDoc subDocs _)   =
+        toDeclInfo ExportDecl{expItemDecl=decl, expItemMbDoc=mbDoc, expItemSubDocs=subDocs}   =
                                         Just(decl,getDoc $ fst mbDoc,map (\ (a,b) -> (a,getDoc $ fst b)) subDocs)
         toDeclInfo (ExportNoDecl _ _)                  = Nothing
         toDeclInfo (ExportGroup _ _ _)                 = Nothing
diff --git a/src/IDE/Metainfo/WorkspaceCollector.hs b/src/IDE/Metainfo/WorkspaceCollector.hs
--- a/src/IDE/Metainfo/WorkspaceCollector.hs
+++ b/src/IDE/Metainfo/WorkspaceCollector.hs
@@ -57,7 +57,7 @@
 import Data.ByteString.Char8 (ByteString)
 import DriverPipeline (preprocess)
 import StringBuffer(hGetStringBuffer)
-import Data.List(partition,sortBy,nub,find)
+import Data.List(partition,sortBy,nub,find,intercalate)
 import Data.Ord(comparing)
 import GHC.Exception
 #if !MIN_VERSION_ghc(7,6,0)
@@ -180,7 +180,7 @@
                                             Nothing -> moduleDescr
                                             Just md  -> mergeWithInterfaceDescr moduleDescr md
                     E.catch (writeExtractedModule destPath writeAscii moduleDescr')
-                        (\ (_::IOException) -> errorM "leksah-server" ("Can't write extracted package " ++ destPath))
+                        (\ (_:: IOException) -> errorM "leksah-server" ("Can't write extracted package " ++ destPath))
                 Left errMsg -> do
                     errorM "leksah-server" $ "Failed to parse " ++ sourcePath ++ " " ++ show errMsg
                     let moduleDescr =  ModuleDescr {
@@ -202,7 +202,7 @@
                         ,   dscTypeHint'    =   ErrorDescr
                         ,   dscExported'    =   False}]}
                     E.catch (deepseq moduleDescr $ writeExtractedModule destPath writeAscii moduleDescr)
-                        (\ (_::IOException) -> errorM "leksah-server" ("Can't write extracted module " ++ destPath))
+                        (\ (_:: IOException) -> errorM "leksah-server" ("Can't write extracted module " ++ destPath))
     ) (\ (e :: SomeException) -> errorM "leksah-server" ("Can't extract module " ++ destPath ++ " " ++ show e))
 
 
@@ -557,12 +557,41 @@
         super           =   []
 
 #if MIN_VERSION_ghc(7,7,0)
-    transformToDescr ((L loc (InstD _inst@(ClsInstD typ))), mbComment, _sigList) =
+    transformToDescr ((L loc (InstD inst)), mbComment, _sigList) =
+        let typp = case inst of
+                     ClsInstD t -> ppr t
+                     DataFamInstD t -> ppr t
+                     TyFamInstD t -> ppr t
+            (instn,nameI,other) =   case words (showSDocUnqual dflags typp) of
+                                        instn':nameI':tl -> (instn',nameI',takeWhile (/= "where") tl)
+                                        _ -> ("","",[])
+        in
+            [Real $ RealDescr {
+            dscName'        =   instn ++ " " ++ nameI
+        ,   dscMbTypeStr'   =   Just (BS.pack (instn ++ " " ++ nameI ++ " " ++ (intercalate " " other)))
+        ,   dscMbModu'      =   Just pm
+        ,   dscMbLocation'  =   srcSpanToLocation loc
+        ,   dscMbComment'   =   toComment mbComment []
+        ,   dscTypeHint'    =   InstanceDescr other
+        ,   dscExported'    =   True}]
+            where
+
 #elif MIN_VERSION_ghc(7,6,0)
     transformToDescr ((L loc (InstD _inst@(ClsInstD typ _ _ _))), mbComment, _sigList) =
+        [Real $ RealDescr {
+        dscName'        =   name
+    ,   dscMbTypeStr'   =   Just (BS.pack ("instance " ++ (showSDocUnqual dflags $ppr typ)))
+    ,   dscMbModu'      =   Just pm
+    ,   dscMbLocation'  =   srcSpanToLocation loc
+    ,   dscMbComment'   =   toComment mbComment []
+    ,   dscTypeHint'    =   InstanceDescr other
+    ,   dscExported'    =   True}]
+        where
+        (name,other)           =   case words (showSDocUnqual dflags $ppr typ) of
+                                [] -> ("",[])
+                                hd:tl -> (hd,tl)
 #else
     transformToDescr ((L loc (InstD _inst@(InstDecl typ _ _ _))), mbComment, _sigList) =
-#endif
         [Real $ RealDescr {
         dscName'        =   name
     ,   dscMbTypeStr'   =   Just (BS.pack ("instance " ++ (showSDocUnqual dflags $ppr typ)))
@@ -575,6 +604,7 @@
         (name,other)           =   case words (showSDocUnqual dflags $ppr typ) of
                                 [] -> ("",[])
                                 hd:tl -> (hd,tl)
+#endif
 
     transformToDescr (_, _mbComment, _sigList) = []
 
diff --git a/src/IDE/Utils/GHCUtils.hs b/src/IDE/Utils/GHCUtils.hs
--- a/src/IDE/Utils/GHCUtils.hs
+++ b/src/IDE/Utils/GHCUtils.hs
@@ -20,16 +20,8 @@
 ,   myParseHeader
 ) where
 
-#if MIN_VERSION_Cabal(1,8,0)
-#else
-import UniqFM (eltsUFM)
-#endif
 import Distribution.Simple (withinRange,PackageIdentifier(..),Dependency(..))
-#if MIN_VERSION_Cabal(1,8,0)
 import qualified Distribution.InstalledPackageInfo as IPI  (sourcePackageId)
-#else
-import qualified Distribution.InstalledPackageInfo as IPI  (package)
-#endif
 import GHC
 import DriverPipeline(preprocess)
 import StringBuffer (StringBuffer(..),hGetStringBuffer)
@@ -58,11 +50,11 @@
 #endif
 import IDE.Utils.FileUtils (getSysLibDir)
 #if MIN_VERSION_ghc(7,7,0)
-import DynFlags (DumpFlag(..), GeneralFlag(..), gopt_set)
+import DynFlags (dopt_set, DumpFlag(..), gopt_set,GeneralFlag(..))
 #endif
 import DynFlags (dopt_set)
 import System.Log.Logger(debugM)
-import Control.Monad.IO.Class (MonadIO(..), MonadIO)
+import Control.Monad.IO.Class (MonadIO(..))
 
 #if !MIN_VERSION_ghc(7,7,0)
 -- this should not be repeated here, why is it necessary?
@@ -123,21 +115,13 @@
 #endif
     pkgInfos        <-  case pkgDatabase dflags1 of
                             Nothing -> return []
-#if MIN_VERSION_Cabal(1,8,0)
                             Just fm -> return fm
-#else
-                            Just fm -> return (eltsUFM fm)
-#endif
     return pkgInfos
 
 findFittingPackages :: [Dependency] -> Ghc [PackageIdentifier]
 findFittingPackages dependencyList = do
     knownPackages   <-  getInstalledPackageInfos
-#if MIN_VERSION_Cabal(1,8,0)
     let packages    =   map IPI.sourcePackageId knownPackages
-#else
-    let packages    =   map IPI.package knownPackages
-#endif
     return (concatMap (fittingKnown packages) dependencyList)
     where
     fittingKnown packages (Dependency dname versionRange) =
diff --git a/src/IDE/Utils/Tool.hs b/src/IDE/Utils/Tool.hs
--- a/src/IDE/Utils/Tool.hs
+++ b/src/IDE/Utils/Tool.hs
@@ -177,6 +177,7 @@
     currentToolCommand <- newEmptyMVar
     return ToolState{..}
 
+isolateToFirst :: Monad m => (o -> Bool) -> C.ConduitM o o m ()
 isolateToFirst p = loop
       where
         loop = C.await >>= maybe (return ()) (\x -> C.yield x >> when (p x) loop)
@@ -330,7 +331,7 @@
         AP.string ":"
         ghciParseExpectedErrorCols
         AP.string ": Not in scope: "
-        (AP.char '`' <|> AP.char '‛')
+        (AP.char '`' <|> AP.char '‛' <|> AP.char '‘')
         result <- parseMarker
         (AP.char '\'' <|> AP.char '’')
         AP.string "\n"
@@ -387,7 +388,7 @@
     return $ enumOutput mvar
   where
     enumOutput :: MonadIO m => MVar RawToolOutput -> C.Source m RawToolOutput
-    enumOutput mvar = loop (0::Int) where
+    enumOutput mvar = loop (0:: Int) where
         loop closed | closed < 2 = do
             v <- liftIO $ takeMVar mvar
             nowClosed <- if (v == ToolOutClosed) || (v == ToolErrClosed)
diff --git a/src/LeksahEcho.hs b/src/LeksahEcho.hs
--- a/src/LeksahEcho.hs
+++ b/src/LeksahEcho.hs
@@ -22,7 +22,7 @@
 main :: IO ()
 main = do
     args <- getArgs
-    appendFile "/Users/hamish/lecho.log" $ show args ++ "/n"
+--    appendFile "/Users/hamish/lecho.log" $ show args ++ "/n"
     if elem  "--version" args
         then putStrLn =<<  getHaddockVersion
         else if elem  "--ghc-version" args
diff --git a/tests/TestTool.hs b/tests/TestTool.hs
--- a/tests/TestTool.hs
+++ b/tests/TestTool.hs
@@ -136,7 +136,7 @@
                 ToolInput "jfkdfjdkl",
                 ToolError "",
 #if __GLASGOW_HASKELL__ > 706
-                ToolError "<interactive>:22:1: Not in scope: ‛jfkdfjdkl’",
+                ToolError "<interactive>:22:1: Not in scope: ‘jfkdfjdkl’",
 #elif __GLASGOW_HASKELL__ > 702
                 ToolError "<interactive>:22:1: Not in scope: `jfkdfjdkl'",
 #else
@@ -162,7 +162,7 @@
                 ToolInput "jfkdfjdkl",
                 ToolError "",
 #if __GLASGOW_HASKELL__ > 706
-                ToolError "<interactive>:35:1: Not in scope: ‛jfkdfjdkl’",
+                ToolError "<interactive>:35:1: Not in scope: ‘jfkdfjdkl’",
 #elif __GLASGOW_HASKELL__ > 702
                 ToolError "<interactive>:37:1: Not in scope: `jfkdfjdkl'",
 #else
