diff --git a/spectral-clustering.cabal b/spectral-clustering.cabal
--- a/spectral-clustering.cabal
+++ b/spectral-clustering.cabal
@@ -1,6 +1,6 @@
 cabal-version: >=1.10
 name: spectral-clustering
-version: 0.2.2.2
+version: 0.2.2.3
 license: GPL-3
 license-file: LICENSE
 copyright: 2019 Gregory W. Schwartz
diff --git a/src/Math/Clustering/Spectral/Dense.hs b/src/Math/Clustering/Spectral/Dense.hs
--- a/src/Math/Clustering/Spectral/Dense.hs
+++ b/src/Math/Clustering/Spectral/Dense.hs
@@ -105,7 +105,7 @@
 bToD (B b) = D
            . H.diag
            . H.flatten
-           $ b
+           $ (H.cmap abs b)
         H.<> ((H.cmap abs $ H.tr b) H.<> ((n H.>< 1) [1,1..]))
   where
     n = H.rows b
diff --git a/src/Math/Clustering/Spectral/Eigen/FeatureMatrix.hs b/src/Math/Clustering/Spectral/Eigen/FeatureMatrix.hs
--- a/src/Math/Clustering/Spectral/Eigen/FeatureMatrix.hs
+++ b/src/Math/Clustering/Spectral/Eigen/FeatureMatrix.hs
@@ -79,7 +79,7 @@
 
 -- | Get the signed diagonal transformed B matrix.
 bToD :: B -> D
-bToD (B b) = D . S.diagCol 0 $ b * ((S._map abs $ S.transpose b) * S.ones n)
+bToD (B b) = D . S.diagCol 0 $ (S._map abs b) * ((S._map abs $ S.transpose b) * S.ones n)
   where
     n = S.rows b
 
diff --git a/src/Math/Clustering/Spectral/Sparse.hs b/src/Math/Clustering/Spectral/Sparse.hs
--- a/src/Math/Clustering/Spectral/Sparse.hs
+++ b/src/Math/Clustering/Spectral/Sparse.hs
@@ -100,7 +100,7 @@
 bToD (B b) = D
            . S.diagonalSM
            . flip S.extractCol 0
-           $ b
+           $ (fmap abs b)
        S.#~# ((fmap abs $ S.transposeSM b) S.#~# (S.fromColsL [S.onesSV n]))
   where
     n = S.nrows b
