diff --git a/Data/Graph/Analysis/Reporting.hs b/Data/Graph/Analysis/Reporting.hs
--- a/Data/Graph/Analysis/Reporting.hs
+++ b/Data/Graph/Analysis/Reporting.hs
@@ -33,12 +33,13 @@
 import Data.GraphViz
 import Data.GraphViz.Attributes.Complete(Attribute(Size), Point(..), createPoint)
 import Data.GraphViz.Exception
+import Data.GraphViz.Commands.IO(writeDotFile)
 
 import Data.Time(getZonedTime, zonedTimeToLocalTime, formatTime)
-import Control.Exception.Extensible(SomeException(..), tryJust)
+import Control.Exception(SomeException(..), tryJust)
 import System.Directory(createDirectoryIfMissing)
 import System.FilePath(makeRelative)
-import System.FilePath.Posix((</>))
+import System.FilePath.Posix((</>), (<.>))
 import System.Locale(defaultTimeLocale)
 import Control.Monad(liftM, when)
 
@@ -205,11 +206,14 @@
 --   not 'Nothing', then the first image links to the second.  The
 --   whole result is wrapped in a 'Paragraph'.  'unDotPath' is applied
 --   to the filename in the 'DocGraph'.
+--
+--   If 'saveDot' is true, then it is assumed that the 'format' isn't
+--   'Canon', 'DotOutput' or 'XDot' (because of filename clashes).
 createGraph :: VisParams -- ^ Visualisation parameters.
                -> DocGraph
                -> IO DocElement
 createGraph params dg
-  = do when (saveDot params) (graphImage rDir gDir vpD dgD >> return ())
+  = do when (saveDot params) (writeDotFile dotFP $ dotGraph dg)
        dl  <- graphImage' rDir gDir vp dg'
        dl' <- maybe return tryImg mvp dl
        return $ Paragraph [dl']
@@ -217,15 +221,13 @@
     rDir = rootDir params
     gDir = graphDir params
     vp = defaultImage params
-    vpD = VProps { size   = DefaultSize
-                 , format = Canon
-                 }
     mvp = largeImage params
     dg' = dg { imageFile = unDotPath $ imageFile dg }
     dgL = checkLargeFilename vp mvp dg'
-    dgD = checkFilename vp vpD "dot" dg'
     tryImg vp' di = liftM (either (const di) (DocLink di))
                    $ graphImage rDir gDir vp' dgL
+
+    dotFP = rDir </> gDir </> imageFile dg <.> "dot"
 
 -- | If both output formats are the same, then the larger image needs
 --   a different filename.
diff --git a/Data/Graph/Analysis/Reporting/Pandoc.hs b/Data/Graph/Analysis/Reporting/Pandoc.hs
--- a/Data/Graph/Analysis/Reporting/Pandoc.hs
+++ b/Data/Graph/Analysis/Reporting/Pandoc.hs
@@ -35,7 +35,7 @@
 import Data.List(intersperse)
 import Data.Maybe(isNothing, fromJust)
 import Control.Arrow((***))
-import Control.Exception.Extensible(SomeException, try)
+import Control.Exception(SomeException, try)
 import System.Directory(removeDirectoryRecursive)
 import System.FilePath((</>), (<.>))
 
diff --git a/Data/Graph/Analysis/Types.hs b/Data/Graph/Analysis/Types.hs
--- a/Data/Graph/Analysis/Types.hs
+++ b/Data/Graph/Analysis/Types.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE TypeFamilies
             , FlexibleContexts
             , TypeSynonymInstances
+            , FlexibleInstances
  #-}
 
 {- |
@@ -34,7 +35,6 @@
       mapNodeType,
       -- * Clustering graphs based on their node labels.
       ClusterLabel(..),
-      ClusterType(..),
       GraphID(..),
       -- * Graph label types.
       GenCluster(..),
@@ -46,12 +46,10 @@
 import Data.Graph.Inductive.Graph
 import Data.Graph.Inductive.PatriciaTree
 
-import Data.GraphViz.Types(GraphID(..))
+import Data.GraphViz.Types(GraphID(..), ToGraphID(..))
 
 import qualified Data.Set as S
 import Data.Set(Set)
-import qualified Data.Text.Lazy as T
-import Data.Text.Lazy(Text)
 
 -- -----------------------------------------------------------------------------
 
@@ -200,7 +198,7 @@
 --   mainly used for visualization purposes, with the 'Ord' instance
 --   required for grouping.  Instances of this class are intended for
 --   use as the label type of graphs.
-class (ClusterType (Cluster cl)) => ClusterLabel cl where
+class (Ord (Cluster cl), ToGraphID (Cluster cl)) => ClusterLabel cl where
     type Cluster cl
     type NodeLabel cl
 
@@ -209,24 +207,6 @@
 
     -- | The actual label.
     nodeLabel :: cl -> NodeLabel cl
-
--- | A class used to define which types are valid for clusters.
-class (Ord c) => ClusterType c where
-    -- | Create a label for visualisation purposes with the GraphViz
-    --   library.
-    clustID :: c -> GraphID
-
-instance ClusterType Int where
-    clustID = Int
-
-instance ClusterType Double where
-    clustID = Dbl
-
-instance ClusterType Text where
-    clustID = Str
-
-instance ClusterType String where
-    clustID = clustID . T.pack
 
 -- | A generic cluster-label type.
 data GenCluster a = GC { clust :: Int
diff --git a/Data/Graph/Analysis/Visualisation.hs b/Data/Graph/Analysis/Visualisation.hs
--- a/Data/Graph/Analysis/Visualisation.hs
+++ b/Data/Graph/Analysis/Visualisation.hs
@@ -62,7 +62,7 @@
 graphvizClusters ps = graphviz params
   where
     params = ps { clusterBy = assignCluster
-                , clusterID = clustID
+                , clusterID = toGraphID
                 }
 
 -- | A function to convert an 'LNode' to the required 'LNodeCluster'
diff --git a/Graphalyze.cabal b/Graphalyze.cabal
--- a/Graphalyze.cabal
+++ b/Graphalyze.cabal
@@ -1,5 +1,5 @@
 Name:                Graphalyze
-Version:             0.12.0.0
+Version:             0.13.0.0
 Synopsis:            Graph-Theoretic Analysis library.
 Description:         A library to use graph theory to analyse the relationships
                         inherent in discrete data.
@@ -19,8 +19,7 @@
 
 
 Library {
-        Build-Depends:   base >= 3 && < 5,
-                         extensible-exceptions,
+        Build-Depends:   base == 4.*,
                          array,
                          containers,
                          directory,
@@ -31,8 +30,8 @@
                          time,
                          bktrees >= 0.2 && <0.4,
                          fgl >= 5.4.2.3 && < 5.5,
-                         graphviz == 2999.12.*,
-                         pandoc == 1.8.*,
+                         graphviz == 2999.13.*,
+                         pandoc >= 1.8 && < 1.10,
                          text
 
         Exposed-Modules:     Data.Graph.Analysis
