diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-08-24 v5.0.1.1
+        * Fix CaseSplitting faliure when using "fancy types" (see #336)
+        * Print error information in "spec" test suite when using `extract`
+
+2014-08-20 v5.0.1
+        * Fix missing file in "Data-Files"
+
 2014-08-20 v5.0.0
 	* ghc-mod consumes much less memory than ghc-mod-4.1.
 	* @serras brought the results of Google Summer code
diff --git a/Language/Haskell/GhcMod.hs b/Language/Haskell/GhcMod.hs
--- a/Language/Haskell/GhcMod.hs
+++ b/Language/Haskell/GhcMod.hs
@@ -15,10 +15,10 @@
   , GhcPkgDb
   , Symbol
   , SymbolDb
+  , GhcModError(..)
   -- * Monad Types
   , GhcModT
   , IOish
-  , GhcModError(..)
   -- * Monad utilities
   , runGhcModT
   , withOptions
diff --git a/Language/Haskell/GhcMod/CaseSplit.hs b/Language/Haskell/GhcMod/CaseSplit.hs
--- a/Language/Haskell/GhcMod/CaseSplit.hs
+++ b/Language/Haskell/GhcMod/CaseSplit.hs
@@ -69,10 +69,10 @@
 -- Information for a function case split
 getSrcSpanTypeForFnSplit :: GhcMonad m => G.ModSummary -> Int -> Int -> m (Maybe SplitInfo)
 getSrcSpanTypeForFnSplit modSum lineNo colNo = do
-    p@ParsedModule{pm_parsed_source = pms} <- G.parseModule modSum
+    p@ParsedModule{pm_parsed_source = _pms} <- G.parseModule modSum
     tcm@TypecheckedModule{tm_typechecked_source = tcs} <- G.typecheckModule p
     let varPat  = find isPatternVar $ listifySpans tcs (lineNo, colNo) :: Maybe (LPat Id)
-        match:_ = listifyParsedSpans pms (lineNo, colNo) :: [Gap.GLMatch]
+        match:_ = listifySpans tcs (lineNo, colNo) :: [Gap.GLMatchI]
     case varPat of
       Nothing  -> return Nothing
       Just varPat' -> do
diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs
--- a/Language/Haskell/GhcMod/Gap.hs
+++ b/Language/Haskell/GhcMod/Gap.hs
@@ -37,6 +37,7 @@
   , benchmarkTargets
   , toModuleString
   , GLMatch
+  , GLMatchI
   , getClass
   , occName
   , setFlags
@@ -437,8 +438,10 @@
 
 #if __GLASGOW_HASKELL__ >= 708
 type GLMatch = LMatch RdrName (LHsExpr RdrName)
+type GLMatchI = LMatch Id (LHsExpr Id)
 #else
 type GLMatch = LMatch RdrName
+type GLMatchI = LMatch Id
 #endif
 
 getClass :: [LInstDecl Name] -> Maybe (Name, SrcSpan)
diff --git a/ghc-mod.cabal b/ghc-mod.cabal
--- a/ghc-mod.cabal
+++ b/ghc-mod.cabal
@@ -1,5 +1,5 @@
 Name:                   ghc-mod
-Version:                5.0.1
+Version:                5.0.1.1
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
                         Daniel Gröber <dxld@darkboxed.org>
                         Alejandro Serrano <trupill@gmail.com>
@@ -31,6 +31,7 @@
                         test/data/cabal.sandbox.config.in
                         test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf
                         test/data/broken-cabal/*.cabal
+                        test/data/broken-cabal/cabal.sandbox.config.in
                         test/data/broken-sandbox/*.cabal
                         test/data/broken-sandbox/cabal.sandbox.config
                         test/data/check-test-subdir/*.cabal
@@ -116,6 +117,9 @@
   else
     Build-Depends:      convertible
                       , Cabal >= 1.10 && < 1.17
+  if impl(ghc <= 7.4.2)
+    -- Only used to constrain random to a version that still works with GHC 7.4
+    Build-Depends:      random <= 1.0.1.1
 
 Executable ghc-mod
   Default-Language:     Haskell2010
diff --git a/test/TestUtils.hs b/test/TestUtils.hs
--- a/test/TestUtils.hs
+++ b/test/TestUtils.hs
@@ -22,10 +22,12 @@
  where
     modifyEnv e = e { gmCradle = (gmCradle e) { cradlePkgDbStack = [GlobalDb] } }
 
-extract :: IO (Either e a, w) -> IO a
+extract :: Show e => IO (Either e a, w) -> IO a
 extract action = do
-  (Right a, _) <- action
-  return a
+  (r,_) <- action
+  case r of
+    Right a ->  return a
+    Left e -> error $ show e
 
 runIsolatedGhcMod :: Options -> GhcModT IO a -> IO a
 runIsolatedGhcMod opt action = do
diff --git a/test/data/broken-cabal/cabal.sandbox.config.in b/test/data/broken-cabal/cabal.sandbox.config.in
new file mode 100644
--- /dev/null
+++ b/test/data/broken-cabal/cabal.sandbox.config.in
@@ -0,0 +1,25 @@
+-- This is a Cabal package environment file.
+-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY.
+-- Please create a 'cabal.config' file in the same directory
+-- if you want to change the default settings for this sandbox.
+
+
+local-repo: @CWD@/test/data/broken-cabal/.cabal-sandbox/packages
+logs-dir: @CWD@/test/data/broken-cabal/.cabal-sandbox/logs
+world-file: @CWD@/test/data/broken-cabal/.cabal-sandbox/world
+user-install: False
+package-db: @CWD@/test/data/broken-cabal/.cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d
+build-summary: @CWD@/test/data/broken-cabal/.cabal-sandbox/logs/build.log
+
+install-dirs
+  prefix: @CWD@/test/data/broken-cabal/.cabal-sandbox
+  bindir: $prefix/bin
+  libdir: $prefix/lib
+  libsubdir: $arch-$os-$compiler/$pkgid
+  libexecdir: $prefix/libexec
+  datadir: $prefix/share
+  datasubdir: $arch-$os-$compiler/$pkgid
+  docdir: $datadir/doc/$arch-$os-$compiler/$pkgid
+  htmldir: $docdir/html
+  haddockdir: $htmldir
+  sysconfdir: $prefix/etc
