diff --git a/Crypto/Number/F2m.hs b/Crypto/Number/F2m.hs
--- a/Crypto/Number/F2m.hs
+++ b/Crypto/Number/F2m.hs
@@ -26,6 +26,8 @@
 import Data.Bits ((.&.),(.|.),xor,shift,testBit)
 import Crypto.Number.Basic
 
+type BinaryPolynomial = Integer
+
 -- | Addition over F₂m. This is just a synonym of  'xor'.
 addF2m :: Integer -> Integer -> Integer
 addF2m = xor
@@ -45,7 +47,9 @@
 {-# INLINE modF2m #-}
 
 -- | Multiplication over F₂m.
-mulF2m :: Integer  -- ^ Irreducible binary polynomial
+--
+--     n1 * n2 (in F(2^m))
+mulF2m :: BinaryPolynomial  -- ^ Irreducible binary polynomial
        -> Integer -> Integer -> Integer
 mulF2m fx n1 n2 = modF2m fx
                 $ go (if n2 `mod` 2 == 1 then n1 else 0) (log2 n2)
@@ -60,7 +64,7 @@
 -- TODO: This is still slower than @mulF2m@.
 
 -- Multiplication table? C?
-squareF2m :: Integer  -- ^ Irreducible binary polynomial
+squareF2m :: BinaryPolynomial  -- ^ Irreducible binary polynomial
           -> Integer -> Integer
 squareF2m fx = modF2m fx . square
 {-# INLINE squareF2m #-}
@@ -76,14 +80,17 @@
         y = n .&. (shift 1 (2 * (ln1 - s) + 1) - 1)
 {-# INLINE square #-}
 
--- | Inversion over  F₂m using extended Euclidean algorithm.
-invF2m :: Integer -- ^ Irreducible binary polynomial
+-- | Inversion of @n over F₂m using extended Euclidean algorithm.
+--
+-- If @n doesn't have an inverse, Nothing is returned.
+invF2m :: BinaryPolynomial -- ^ Irreducible binary polynomial
        -> Integer -> Maybe Integer
 invF2m _  0 = Nothing
-invF2m fx n = go n fx 1 0
+invF2m fx n
+    | n >= fx   = Nothing
+    | otherwise = go n fx 1 0
     where
       go u v g1 g2
-          | u == 0    = Nothing
           | u == 1    = Just $ modF2m fx g1
           | j < 0     = go u  (v  `xor` shift  u (-j)) g1 (g2 `xor` shift g1 (-j))
           | otherwise = go (u  `xor` shift v  j) v (g1 `xor` shift g2 j) g2
@@ -93,7 +100,9 @@
 
 -- | Division over F₂m. If the dividend doesn't have an inverse it returns
 -- 'Nothing'.
-divF2m :: Integer  -- ^ Irreducible binary polynomial
+--
+-- Compute n1 / n2
+divF2m :: BinaryPolynomial  -- ^ Irreducible binary polynomial
        -> Integer  -- ^ Dividend
        -> Integer  -- ^ Quotient
        -> Maybe Integer
diff --git a/Crypto/Number/ModArithmetic.hs b/Crypto/Number/ModArithmetic.hs
--- a/Crypto/Number/ModArithmetic.hs
+++ b/Crypto/Number/ModArithmetic.hs
@@ -51,13 +51,19 @@
 -- When used with integer-simple, this function is not different
 -- from expFast, and thus provide the same unstudied and dubious
 -- timing and side channels claims.
+--
+-- with GHC 7.10, the powModSecInteger is missing from integer-gmp
+-- (which is now integer-gmp2), so is has the same security as old
+-- ghc version.
 expSafe :: Integer -- ^ base
         -> Integer -- ^ exponant
         -> Integer -- ^ modulo
         -> Integer -- ^ result
 #if MIN_VERSION_integer_gmp(0,5,1)
 expSafe b e m
+#if MIN_VERSION_integer_gmp(1,0,0)
     | odd m     = powModSecInteger b e m
+#endif
     | otherwise = powModInteger b e m
 #else
 expSafe = exponentiation
diff --git a/Crypto/Number/Serialize.hs b/Crypto/Number/Serialize.hs
--- a/Crypto/Number/Serialize.hs
+++ b/Crypto/Number/Serialize.hs
@@ -27,6 +27,9 @@
 import Foreign.Ptr
 
 #if MIN_VERSION_integer_gmp(0,5,1)
+#if __GLASGOW_HASKELL__ >= 710
+import Control.Monad (void)
+#endif
 import GHC.Integer.GMP.Internals
 import GHC.Base
 import GHC.Ptr
@@ -67,7 +70,7 @@
 i2osp m = B.unsafeCreate (I# (word2Int# sz)) fillPtr
   where !sz = sizeInBaseInteger m 256#
 #if __GLASGOW_HASKELL__ >= 710
-        fillPtr (Ptr srcAddr) = exportIntegerToAddr m srcAddr 1#
+        fillPtr (Ptr srcAddr) = void $ exportIntegerToAddr m srcAddr 1#
 #else
         fillPtr (Ptr srcAddr) = IO $ \s -> case exportIntegerToAddr m srcAddr 1# s of
                                                 (# s2, _ #) -> (# s2, () #)
@@ -117,7 +120,7 @@
             | len == isz =
                 let !(Ptr srcAddr) = ptr in
 #if __GLASGOW_HASKELL__ >= 710
-                exportIntegerToAddr m srcAddr 1#
+                void (exportIntegerToAddr m srcAddr 1#)
 #else
                 IO $ \s -> case exportIntegerToAddr m srcAddr 1# s of
                                 (# s2, _ #) -> (# s2, () #)
@@ -127,7 +130,7 @@
                 _ <- B.memset ptr 0 (fromIntegral len)
                 let !(Ptr addr) = ptr `plusPtr` z
 #if __GLASGOW_HASKELL__ >= 710
-                exportIntegerToAddr m addr 1#
+                void (exportIntegerToAddr m addr 1#)
 #else
                 IO $ \s -> case exportIntegerToAddr m addr 1# s of
                                 (# s2, _ #) -> (# s2, () #)
diff --git a/Tests/Tests.hs b/Tests/Tests.hs
--- a/Tests/Tests.hs
+++ b/Tests/Tests.hs
@@ -176,7 +176,7 @@
         ]
     , testGroup "F2m"
         [ testCase "inv2Fm 1" (invF2m 283 566 @?= Nothing)
-        , testCase "inv2Fm 1" (invF2m 283 64800122153546929198091027632453789752394810192663929321789113225485980298851325347397170296259938610151214285229944494947456450203170796566256526607878773803495973593989422 @?= Nothing)
+        , testCase "inv2Fm 2" (invF2m 283 64800122153546929198091027632453789752394810192663929321789113225485980298851325347397170296259938610151214285229944494947456450203170796566256526607878773803495973593989422 @?= Nothing)
         , testProperty "invF2m" prop_invF2m_valid
         , testProperty "squareF2m" prop_squareF2m_valid
         ]
diff --git a/crypto-numbers.cabal b/crypto-numbers.cabal
--- a/crypto-numbers.cabal
+++ b/crypto-numbers.cabal
@@ -1,5 +1,5 @@
 Name:                crypto-numbers
-Version:             0.2.5
+Version:             0.2.6
 Description:         Cryptographic numbers: functions and algorithms
 License:             BSD3
 License-file:        LICENSE
@@ -44,7 +44,7 @@
                    , bytestring
                    , byteable
                    , vector
-                   , tasty >= 0.10.0.1
+                   , tasty
                    , tasty-quickcheck
                    , tasty-hunit
   ghc-options:       -Wall -O2
