diff --git a/Math/NumberTheory/Roots/General.hs b/Math/NumberTheory/Roots/General.hs
--- a/Math/NumberTheory/Roots/General.hs
+++ b/Math/NumberTheory/Roots/General.hs
@@ -27,6 +27,9 @@
 #if MIN_VERSION_base(4,16,0)
 import GHC.Exts (word16ToWord#)
 #endif
+#ifdef WORDS_BIGENDIAN
+import GHC.Exts (byteSwap#)
+#endif
 import GHC.Integer.GMP.Internals (Integer(..), shiftLInteger, shiftRInteger)
 import GHC.Integer.Logarithms (integerLog2#)
 import Numeric.Natural (Natural)
@@ -255,11 +258,21 @@
 smallOddPrimes :: [Integer]
 smallOddPrimes
   = takeWhile (< spBound)
+  $ map (\(I# k#) -> S# (word2Int# (
 #if MIN_VERSION_base(4,16,0)
-  $ map (\(I# k#) -> S# (word2Int# (word16ToWord# (indexWord16OffAddr# smallPrimesAddr# k#))))
+#ifdef WORDS_BIGENDIAN
+  byteSwap16# (word16ToWord# (indexWord16OffAddr# smallPrimesAddr# k#))
 #else
-  $ map (\(I# k#) -> S# (word2Int# (indexWord16OffAddr# smallPrimesAddr# k#)))
+  word16ToWord# (indexWord16OffAddr# smallPrimesAddr# k#)
 #endif
+#else
+#ifdef WORDS_BIGENDIAN
+  byteSwap16# (indexWord16OffAddr# smallPrimesAddr# k#)
+#else
+  indexWord16OffAddr# smallPrimesAddr# k#
+#endif
+#endif
+  )))
     [1 .. smallPrimesLength - 1]
   where
     !(Ptr smallPrimesAddr#) = smallPrimesPtr
diff --git a/Math/NumberTheory/Utils/BitMask.hs b/Math/NumberTheory/Utils/BitMask.hs
--- a/Math/NumberTheory/Utils/BitMask.hs
+++ b/Math/NumberTheory/Utils/BitMask.hs
@@ -7,6 +7,7 @@
 -- Bit mask utilities.
 --
 
+{-# LANGUAGE CPP          #-}
 {-# LANGUAGE MagicHash    #-}
 
 module Math.NumberTheory.Utils.BitMask
@@ -14,8 +15,13 @@
   -- , vectorToAddrLiteral
   ) where
 
+#include "MachDeps.h"
+
 import Data.Bits (countTrailingZeros, finiteBitSize, testBit, (.&.))
 import GHC.Exts (Int(..), Word(..), Ptr(..), iShiftRL#, indexWordOffAddr#)
+#ifdef WORDS_BIGENDIAN
+import GHC.Exts (byteSwap#)
+#endif
 
 -- import Data.Bits (unsafeShiftL)
 -- import Data.List (unfoldr)
@@ -27,7 +33,12 @@
     fbs = finiteBitSize (0 :: Word)
     logFbs# = case countTrailingZeros fbs of
       I# l# -> l#
-    word = W# (indexWordOffAddr# addr# (i# `iShiftRL#` logFbs#))
+    word# = indexWordOffAddr# addr# (i# `iShiftRL#` logFbs#)
+#ifdef WORDS_BIGENDIAN
+    word = W# (byteSwap# word#)
+#else
+    word = W# word#
+#endif
 
 -- vectorToAddrLiteral :: [Bool] -> String
 -- vectorToAddrLiteral = map (chr . toByte . padTo8) . unfoldr go
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# integer-roots [![Build Status](https://github.com/Bodigrim/integer-roots/workflows/Haskell-CI/badge.svg)](https://github.com/Bodigrim/integer-roots/actions?query=workflow%3AHaskell-CI) [![Hackage](http://img.shields.io/hackage/v/integer-roots.svg)](https://hackage.haskell.org/package/integer-roots) [![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/integer-roots/badge)](https://matrix.hackage.haskell.org/package/integer-roots) [![Stackage LTS](http://stackage.org/package/integer-roots/badge/lts)](http://stackage.org/lts/package/integer-roots) [![Stackage Nightly](http://stackage.org/package/integer-roots/badge/nightly)](http://stackage.org/nightly/package/integer-roots)
+# integer-roots [![Hackage](http://img.shields.io/hackage/v/integer-roots.svg)](https://hackage.haskell.org/package/integer-roots) [![Stackage LTS](http://stackage.org/package/integer-roots/badge/lts)](http://stackage.org/lts/package/integer-roots) [![Stackage Nightly](http://stackage.org/package/integer-roots/badge/nightly)](http://stackage.org/nightly/package/integer-roots)
 
 Calculating integer roots and testing perfect powers of arbitrary precision.
 
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,7 @@
+# 1.0.1.0
+
+* Fixes for big-endian architectures.
+
 # 1.0.0.1
 
 * Compatibility fixes for GHC 9.2.
diff --git a/integer-roots.cabal b/integer-roots.cabal
--- a/integer-roots.cabal
+++ b/integer-roots.cabal
@@ -1,5 +1,5 @@
 name:          integer-roots
-version:       1.0.0.1
+version:       1.0.1.0
 cabal-version: >=1.10
 build-type:    Simple
 license:       MIT
@@ -12,7 +12,7 @@
 description:   Calculating integer roots and testing perfect powers of arbitrary precision. Originally part of <https://hackage.haskell.org/package/arithmoi arithmoi> package.
 category:      Math, Algorithms, Number Theory
 author:        Daniel Fischer, Andrew Lelechenko
-tested-with:   GHC ==8.0.2 GHC ==8.2.2 GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.4 GHC ==8.10.4 GHC ==9.0.1
+tested-with:   GHC ==8.0.2 GHC ==8.2.2 GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.1 GHC ==9.2.1
 extra-source-files:
   changelog.md
   README.md
@@ -62,6 +62,8 @@
   ghc-options: -Wall -Widentities -Wcompat
 
 test-suite integer-roots-doctests
+  if impl(ghc >= 9.2)
+    buildable: False
   type: exitcode-stdio-1.0
   main-is: Doctest.hs
   hs-source-dirs: test-suite
diff --git a/test-suite/Math/NumberTheory/TestUtils.hs b/test-suite/Math/NumberTheory/TestUtils.hs
--- a/test-suite/Math/NumberTheory/TestUtils.hs
+++ b/test-suite/Math/NumberTheory/TestUtils.hs
@@ -8,6 +8,7 @@
 --
 
 {-# LANGUAGE ConstraintKinds            #-}
+{-# LANGUAGE CPP                        #-}
 {-# LANGUAGE DataKinds                  #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -51,6 +52,22 @@
 instance Arbitrary Natural where
   arbitrary = fromInteger <$> (arbitrary `suchThat` (>= 0))
   shrink = map fromInteger . filter (>= 0) . shrink . toInteger
+
+#if !MIN_VERSION_smallcheck(1,2,0)
+instance Functor NonNegative where
+  fmap f (NonNegative x) = NonNegative (f x)
+
+instance (Num a, Bounded a) => Bounded (NonNegative a) where
+  minBound = NonNegative 0
+  maxBound = NonNegative (maxBound :: a)
+
+instance Functor Positive where
+  fmap f (Positive x) = Positive (f x)
+
+instance (Num a, Bounded a) => Bounded (Positive a) where
+  minBound = Positive 1
+  maxBound = Positive (maxBound :: a)
+#endif
 
 -------------------------------------------------------------------------------
 
