diff --git a/compdata-dags.cabal b/compdata-dags.cabal
--- a/compdata-dags.cabal
+++ b/compdata-dags.cabal
@@ -1,5 +1,5 @@
 Name:			compdata-dags
-Version:		0.2
+Version:		0.2.1
 Synopsis:            	Compositional Data Types on DAGs
 Description:
   This library implements recursion schemes on directed acyclic
@@ -12,7 +12,7 @@
 License:                BSD3
 License-file:           LICENSE
 Author:                 Patrick Bahr, Emil Axelsson
-Maintainer:             paba@di.ku.dk
+Maintainer:             paba@itu.dk
 Build-Type:             Simple
 Cabal-Version:          >=1.9.2
 bug-reports:            https://github.com/pa-ba/compdata-dags/issues
@@ -34,7 +34,7 @@
   Other-Modules:        Data.Comp.Dag.Internal
                         Data.Comp.AG.Internal
                         Data.Comp.PAG.Internal
-  Build-Depends:	base >= 4.7, base < 5, compdata == 0.10.*, unordered-containers, 
+  Build-Depends:	base >= 4.7, base < 5, compdata >= 0.10, unordered-containers, 
                         mtl, containers, vector
   hs-source-dirs:	src
   ghc-options:          -W
@@ -44,10 +44,26 @@
   Type:                 exitcode-stdio-1.0
   Main-is:		RunTests.hs
   hs-source-dirs:	tests examples src
-  Build-Depends:        base >= 4.7, base < 5, compdata == 0.10.*, unordered-containers, 
+  Build-Depends:        base >= 4.7, base < 5, compdata >= 0.10, unordered-containers, 
                         mtl, containers, vector, test-framework-hunit, HUnit, test-framework,
                         QuickCheck >= 2 && < 2.8, test-framework-quickcheck2 >= 0.3
-
+  Other-Modules:        Data.Comp.AG
+                        Data.Comp.AG.Internal
+                        Data.Comp.Dag
+                        Data.Comp.Dag.AG
+                        Data.Comp.Dag.Internal
+                        Data.Comp.Dag.PAG
+                        Data.Comp.PAG
+                        Data.Comp.PAG.Internal
+                        Examples.LeavesBelow
+                        Examples.Repmin
+                        Examples.RepminPAG
+                        Examples.TypeInference
+                        Examples.Types
+                        Examples.Circuit
+                        Test.Dag
+                        Test.Examples
+                        Test.Utils
 
 source-repository head
   type:     git
diff --git a/examples/Examples/LeavesBelow.hs b/examples/Examples/LeavesBelow.hs
--- a/examples/Examples/LeavesBelow.hs
+++ b/examples/Examples/LeavesBelow.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TypeOperators  #-}
 {-# LANGUAGE ImplicitParams #-}
-
+{-# LANGUAGE FlexibleContexts #-}
 
 module Examples.LeavesBelow where
 
diff --git a/examples/Examples/Repmin.hs b/examples/Examples/Repmin.hs
--- a/examples/Examples/Repmin.hs
+++ b/examples/Examples/Repmin.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TypeOperators  #-}
 {-# LANGUAGE ImplicitParams #-}
-
+{-# LANGUAGE FlexibleContexts #-}
 
 module Examples.Repmin where
 
diff --git a/examples/Examples/RepminPAG.hs b/examples/Examples/RepminPAG.hs
--- a/examples/Examples/RepminPAG.hs
+++ b/examples/Examples/RepminPAG.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveFunctor #-}
 {-# LANGUAGE DeriveFoldable #-}
 {-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleContexts #-}
 
 -- This is an implementation of repmin as a PAG. The use of a PAG
 -- allows us to implement repmin such that the result of repmin is a
diff --git a/src/Data/Comp/AG/Internal.hs b/src/Data/Comp/AG/Internal.hs
--- a/src/Data/Comp/AG/Internal.hs
+++ b/src/Data/Comp/AG/Internal.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE Rank2Types            #-}
 {-# LANGUAGE TypeOperators         #-}
+{-# LANGUAGE FlexibleContexts      #-}
 
 --------------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Comp/Dag.hs b/src/Data/Comp/Dag.hs
--- a/src/Data/Comp/Dag.hs
+++ b/src/Data/Comp/Dag.hs
@@ -30,7 +30,6 @@
     , strongIso
     ) where
 
-import Control.Applicative
 import Control.Exception.Base
 import Control.Monad.State
 import Data.Comp.Dag.Internal
diff --git a/src/Data/Comp/Dag/AG.hs b/src/Data/Comp/Dag/AG.hs
--- a/src/Data/Comp/Dag/AG.hs
+++ b/src/Data/Comp/Dag/AG.hs
@@ -84,7 +84,6 @@
                              let d' = lookupNumMap d i m
                              u' <- runF d' s -- recurse
                              return (Numbered i (u',d'))
-             writeSTRef count 0  -- re-initialize counter
              result <- Traversable.mapM run' t
              return u
           -- recurses through the tree structure
@@ -101,6 +100,7 @@
           runF d (Term t)  = run d t
           -- This function is applied to each edge
           iter (n, t) = do
+            writeSTRef count 0  -- re-initialize counter
             u <- run (fromJust $ dmapFin Vec.! n) t
             MVec.unsafeWrite umap n u
       -- first apply to the root
@@ -143,6 +143,7 @@
       let -- This function is applied to each edge
           iter (node,s) = do
              let d = fromJust $ dmapFin Vec.! node
+             writeSTRef count 0
              (u,t) <- run d s
              MVec.unsafeWrite umap node u
              MVec.unsafeWrite allEdges node t
@@ -161,7 +162,6 @@
                              let d' = lookupNumMap d i m
                              (u',t) <- runF d' s
                              return (Numbered i ((u',d'), t))
-             writeSTRef count 0
              result <- Traversable.mapM run' t
              let t' = join $ fmap (snd . unNumbered) $ explicit rewr (u,d) (fst . unNumbered) result
              return (u, t')
diff --git a/src/Data/Comp/Dag/PAG.hs b/src/Data/Comp/Dag/PAG.hs
--- a/src/Data/Comp/Dag/PAG.hs
+++ b/src/Data/Comp/Dag/PAG.hs
@@ -87,6 +87,7 @@
       let -- This function is applied to each edge
           iter (node,s) = do
              let d = fromJust $ dmapFin Vec.! node
+             writeSTRef count 0
              u <- run d s
              MVec.unsafeWrite umap node u
           -- Runs the AG on an edge with the given input inherited
@@ -111,7 +112,6 @@
                                        Just d' -> d'
                              u' <- runF d' s
                              return (Numbered i (u' :*: d'))
-             writeSTRef count 0
              result <- Traversable.mapM run' t
              return u
           -- recurses through the tree structure
diff --git a/src/Data/Comp/PAG/Internal.hs b/src/Data/Comp/PAG/Internal.hs
--- a/src/Data/Comp/PAG/Internal.hs
+++ b/src/Data/Comp/PAG/Internal.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE Rank2Types            #-}
 {-# LANGUAGE TypeOperators         #-}
+{-# LANGUAGE FlexibleContexts      #-}
 
 --------------------------------------------------------------------------------
 -- |
