diff --git a/Math/NumberTheory/ArithmeticFunctions/Class.hs b/Math/NumberTheory/ArithmeticFunctions/Class.hs
--- a/Math/NumberTheory/ArithmeticFunctions/Class.hs
+++ b/Math/NumberTheory/ArithmeticFunctions/Class.hs
@@ -21,6 +21,7 @@
 #if __GLASGOW_HASKELL__ < 803
 import Data.Semigroup
 #endif
+import Prelude hiding (Applicative(..))
 
 import Math.NumberTheory.Primes
 
diff --git a/Math/NumberTheory/Primes/Counting/Impl.hs b/Math/NumberTheory/Primes/Counting/Impl.hs
--- a/Math/NumberTheory/Primes/Counting/Impl.hs
+++ b/Math/NumberTheory/Primes/Counting/Impl.hs
@@ -11,6 +11,8 @@
 {-# LANGUAGE ScopedTypeVariables #-}
 
 {-# OPTIONS_GHC -fspec-constr-count=24 #-}
+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
+
 module Math.NumberTheory.Primes.Counting.Impl
     ( primeCount
     , primeCountMaxArg
diff --git a/Math/NumberTheory/Primes/Factorisation/Montgomery.hs b/Math/NumberTheory/Primes/Factorisation/Montgomery.hs
--- a/Math/NumberTheory/Primes/Factorisation/Montgomery.hs
+++ b/Math/NumberTheory/Primes/Factorisation/Montgomery.hs
@@ -181,12 +181,12 @@
                 fmap mconcat $ forM cs $
                   \(x, xm) -> if ptest x
                               then pure $ singlePrimeFactor x xm
-                              else repFact x b1 b2 (count - 1)
+                              else fmap (modifyPowers (* xm)) (repFact x b1 b2 (count - 1))
 
 data Factors = Factors
   { _primeFactors     :: [(Integer, Word)]
   , _compositeFactors :: [(Integer, Word)]
-  }
+  } deriving (Show)
 
 singlePrimeFactor :: Integer -> Word -> Factors
 singlePrimeFactor a b = Factors [(a, b)] []
diff --git a/arithmoi.cabal b/arithmoi.cabal
--- a/arithmoi.cabal
+++ b/arithmoi.cabal
@@ -1,5 +1,5 @@
 name:          arithmoi
-version:       0.12.0.2
+version:       0.12.1.0
 cabal-version: 2.0
 build-type:    Simple
 license:       MIT
@@ -17,7 +17,7 @@
   powers (integer roots and tests, modular exponentiation).
 category:      Math, Algorithms, Number Theory
 author:        Andrew Lelechenko, Daniel Fischer
-tested-with:   GHC ==8.2.2 GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.2 GHC ==9.2.4 GHC ==9.4.1
+tested-with:   GHC ==8.2.2 GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.2 GHC ==9.2.5 GHC ==9.4.4 GHC ==9.6.1
 extra-source-files:
   changelog.md
 
@@ -184,11 +184,8 @@
     mod,
     random,
     semirings,
+    tasty-bench,
     vector
-  build-depends:
-    tasty-bench
-  mixins:
-    tasty-bench (Test.Tasty.Bench as Gauge.Main)
   other-modules:
     Math.NumberTheory.ArithmeticFunctionsBench
     Math.NumberTheory.DiscreteLogarithmBench
diff --git a/benchmark/Bench.hs b/benchmark/Bench.hs
--- a/benchmark/Bench.hs
+++ b/benchmark/Bench.hs
@@ -1,6 +1,6 @@
 module Main where
 
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Math.NumberTheory.ArithmeticFunctionsBench as ArithmeticFunctions
 import Math.NumberTheory.DiscreteLogarithmBench as DiscreteLogarithm
diff --git a/benchmark/Math/NumberTheory/ArithmeticFunctionsBench.hs b/benchmark/Math/NumberTheory/ArithmeticFunctionsBench.hs
--- a/benchmark/Math/NumberTheory/ArithmeticFunctionsBench.hs
+++ b/benchmark/Math/NumberTheory/ArithmeticFunctionsBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 import Data.Set (Set)
 
 import Math.NumberTheory.ArithmeticFunctions as A
diff --git a/benchmark/Math/NumberTheory/DiscreteLogarithmBench.hs b/benchmark/Math/NumberTheory/DiscreteLogarithmBench.hs
--- a/benchmark/Math/NumberTheory/DiscreteLogarithmBench.hs
+++ b/benchmark/Math/NumberTheory/DiscreteLogarithmBench.hs
@@ -11,7 +11,7 @@
   , discreteLogarithm'
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 import Control.Monad
 import Data.Maybe
 import Data.Mod
diff --git a/benchmark/Math/NumberTheory/EisensteinIntegersBench.hs b/benchmark/Math/NumberTheory/EisensteinIntegersBench.hs
--- a/benchmark/Math/NumberTheory/EisensteinIntegersBench.hs
+++ b/benchmark/Math/NumberTheory/EisensteinIntegersBench.hs
@@ -6,7 +6,7 @@
   ) where
 
 import Data.Maybe
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Math.NumberTheory.ArithmeticFunctions (tau)
 import Math.NumberTheory.Primes (isPrime)
diff --git a/benchmark/Math/NumberTheory/GaussianIntegersBench.hs b/benchmark/Math/NumberTheory/GaussianIntegersBench.hs
--- a/benchmark/Math/NumberTheory/GaussianIntegersBench.hs
+++ b/benchmark/Math/NumberTheory/GaussianIntegersBench.hs
@@ -5,7 +5,7 @@
   ) where
 
 import Data.Maybe
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Math.NumberTheory.ArithmeticFunctions (tau)
 import Math.NumberTheory.Primes (isPrime)
diff --git a/benchmark/Math/NumberTheory/InverseBench.hs b/benchmark/Math/NumberTheory/InverseBench.hs
--- a/benchmark/Math/NumberTheory/InverseBench.hs
+++ b/benchmark/Math/NumberTheory/InverseBench.hs
@@ -7,7 +7,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 import Data.Bits (Bits)
 import Data.Euclidean
 import Numeric.Natural
diff --git a/benchmark/Math/NumberTheory/JacobiBench.hs b/benchmark/Math/NumberTheory/JacobiBench.hs
--- a/benchmark/Math/NumberTheory/JacobiBench.hs
+++ b/benchmark/Math/NumberTheory/JacobiBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 import Numeric.Natural
 
 import Math.NumberTheory.Moduli.Sqrt
diff --git a/benchmark/Math/NumberTheory/MertensBench.hs b/benchmark/Math/NumberTheory/MertensBench.hs
--- a/benchmark/Math/NumberTheory/MertensBench.hs
+++ b/benchmark/Math/NumberTheory/MertensBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Math.NumberTheory.ArithmeticFunctions.Mertens
 
diff --git a/benchmark/Math/NumberTheory/PrimesBench.hs b/benchmark/Math/NumberTheory/PrimesBench.hs
--- a/benchmark/Math/NumberTheory/PrimesBench.hs
+++ b/benchmark/Math/NumberTheory/PrimesBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 import System.Random
 
 import Math.NumberTheory.Logarithms (integerLog2)
diff --git a/benchmark/Math/NumberTheory/PrimitiveRootsBench.hs b/benchmark/Math/NumberTheory/PrimitiveRootsBench.hs
--- a/benchmark/Math/NumberTheory/PrimitiveRootsBench.hs
+++ b/benchmark/Math/NumberTheory/PrimitiveRootsBench.hs
@@ -6,7 +6,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 import Data.Constraint
 import Data.Maybe
 
diff --git a/benchmark/Math/NumberTheory/RecurrencesBench.hs b/benchmark/Math/NumberTheory/RecurrencesBench.hs
--- a/benchmark/Math/NumberTheory/RecurrencesBench.hs
+++ b/benchmark/Math/NumberTheory/RecurrencesBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Data.Euclidean (GcdDomain)
 import Math.NumberTheory.Recurrences
diff --git a/benchmark/Math/NumberTheory/SequenceBench.hs b/benchmark/Math/NumberTheory/SequenceBench.hs
--- a/benchmark/Math/NumberTheory/SequenceBench.hs
+++ b/benchmark/Math/NumberTheory/SequenceBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Data.Array.Unboxed
 import Data.Bits
diff --git a/benchmark/Math/NumberTheory/SieveBlockBench.hs b/benchmark/Math/NumberTheory/SieveBlockBench.hs
--- a/benchmark/Math/NumberTheory/SieveBlockBench.hs
+++ b/benchmark/Math/NumberTheory/SieveBlockBench.hs
@@ -7,7 +7,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 #if __GLASGOW_HASKELL__ < 803
 import Data.Semigroup
 #endif
diff --git a/benchmark/Math/NumberTheory/SmoothNumbersBench.hs b/benchmark/Math/NumberTheory/SmoothNumbersBench.hs
--- a/benchmark/Math/NumberTheory/SmoothNumbersBench.hs
+++ b/benchmark/Math/NumberTheory/SmoothNumbersBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Math.NumberTheory.Primes
 import Math.NumberTheory.SmoothNumbers
diff --git a/benchmark/Math/NumberTheory/ZetaBench.hs b/benchmark/Math/NumberTheory/ZetaBench.hs
--- a/benchmark/Math/NumberTheory/ZetaBench.hs
+++ b/benchmark/Math/NumberTheory/ZetaBench.hs
@@ -4,7 +4,7 @@
   ( benchSuite
   ) where
 
-import Gauge.Main
+import Test.Tasty.Bench
 
 import Math.NumberTheory.Zeta
 
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,11 @@
 # Changelog
 
+## 0.12.1.0
+
+### Fixed
+
+* Fix a grave bug in prime factorisation, lurking since `arithmoi-0.7.0.0`.
+
 ## 0.12.0.2
 
 ### Fixed
diff --git a/test-suite/Math/NumberTheory/GaussianIntegersTests.hs b/test-suite/Math/NumberTheory/GaussianIntegersTests.hs
--- a/test-suite/Math/NumberTheory/GaussianIntegersTests.hs
+++ b/test-suite/Math/NumberTheory/GaussianIntegersTests.hs
@@ -1,4 +1,5 @@
 {-# OPTIONS_GHC -fno-warn-type-defaults #-}
+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
 
 -- |
 -- Module:      Math.NumberTheory.GaussianIntegersTests
diff --git a/test-suite/Math/NumberTheory/Moduli/SqrtTests.hs b/test-suite/Math/NumberTheory/Moduli/SqrtTests.hs
--- a/test-suite/Math/NumberTheory/Moduli/SqrtTests.hs
+++ b/test-suite/Math/NumberTheory/Moduli/SqrtTests.hs
@@ -11,6 +11,7 @@
 {-# LANGUAGE ViewPatterns    #-}
 
 {-# OPTIONS_GHC -fno-warn-type-defaults #-}
+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
 
 module Math.NumberTheory.Moduli.SqrtTests
   ( testSuite
diff --git a/test-suite/Math/NumberTheory/Primes/FactorisationTests.hs b/test-suite/Math/NumberTheory/Primes/FactorisationTests.hs
--- a/test-suite/Math/NumberTheory/Primes/FactorisationTests.hs
+++ b/test-suite/Math/NumberTheory/Primes/FactorisationTests.hs
@@ -57,6 +57,9 @@
   -- , (16757651897802863152387219654541878166,[(2,1),(23,1),(277,1),(505353699591289,1),(2602436338718275457,1)])
   , ((10 ^ 80 - 1) `div` 9, [(11,1),(17,1),(41,1),(73,1),(101,1),(137,1),(271,1),(3541,1),(9091,1),(27961,1),
                              (1676321,1),(5070721,1),(5882353,1),(5964848081,1),(19721061166646717498359681,1)])
+  , (623506907396924300595652906937, [(300137,1),(825131,2),(1746779,2)])
+  , (626472835738582668418814215862, [(2,1),(150211,1),(11746151,2),(122939,2)])
+  , (638396704483535474833679624037, [(3,1),(11,2),(100519,1),(104281,2),(1268419,2)])
   ]
 
 lazyCases :: [(Integer, [(Integer, Word)])]
