diff --git a/edges.cabal b/edges.cabal
--- a/edges.cabal
+++ b/edges.cabal
@@ -1,5 +1,5 @@
 name: edges
-version: 0.9
+version: 0.9.0.1
 category: Graphs
 synopsis: Tools for efficient immutable graphs
 description: A set of tools for constructing immutable graphs which are both memory and performance-efficient.
diff --git a/library/Edges/Functions.hs b/library/Edges/Functions.hs
--- a/library/Edges/Functions.hs
+++ b/library/Edges/Functions.hs
@@ -70,4 +70,4 @@
 
 unindexNodeCounts :: (Eq entity, Hashable entity) => (Int -> Maybe entity) -> NodeCounts entity -> HashMap entity Int
 unindexNodeCounts lookup (NodeCounts pa) =
-  Unfold.fold (Foldl.hashMapByKeyLookup lookup) (fmap fromIntegral (Unfold.primArray pa))
+  Unfold.fold (Foldl.hashMapByKeyLookup lookup) (Unfold.intsInRange 0 (pred (sizeofPrimArray pa)))
