diff --git a/som.cabal b/som.cabal
--- a/som.cabal
+++ b/som.cabal
@@ -1,5 +1,5 @@
 Name:              som
-Version:           8.2.2
+Version:           8.2.3
 Stability:         experimental
 Synopsis:          Self-Organising Maps.
 Description:       A Kohonen Self-organising Map (SOM) maps input patterns 
@@ -33,7 +33,7 @@
 source-repository this
   type:     git
   location: https://github.com/mhwombat/som.git
-  tag:      8.2.2
+  tag:      8.2.3
 
 
 library
diff --git a/src/Data/Datamining/Clustering/SOSInternal.hs b/src/Data/Datamining/Clustering/SOSInternal.hs
--- a/src/Data/Datamining/Clustering/SOSInternal.hs
+++ b/src/Data/Datamining/Clustering/SOSInternal.hs
@@ -109,7 +109,7 @@
 
 -- | Returns the number of models the SOS currently contains.
 numModels :: SOS t x k p -> Int
-numModels = length . M.keys . toMap
+numModels = M.size . toMap
 
 -- | Returns a map from node ID to model.
 modelMap :: SOS t x k p -> M.Map k p
diff --git a/src/Data/Datamining/Clustering/SSOMInternal.hs b/src/Data/Datamining/Clustering/SSOMInternal.hs
--- a/src/Data/Datamining/Clustering/SSOMInternal.hs
+++ b/src/Data/Datamining/Clustering/SSOMInternal.hs
@@ -110,7 +110,7 @@
     => Classifier (SSOM t) x k p where
   toList = M.toList . toMap
   -- TODO: If the # of models is fixed, make more efficient
-  numModels = length . M.keys . sMap
+  numModels = M.size . sMap
   models = M.elems . toMap
   differences s p = M.toList . M.map (difference s p) $ toMap s
   trainBatch s = incrementCounter . foldl' justTrain s
