diff --git a/pairing.cabal b/pairing.cabal
--- a/pairing.cabal
+++ b/pairing.cabal
@@ -2,10 +2,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: d047536a7348fa341206f72c42c935d58cf595375dbccae1dbcf0789040cbeb0
+-- hash: c54816acbfcbae987dfabc18793935f2ee26262bbaf23e1efad1ae5f22512cb0
 
 name:           pairing
-version:        0.3.0
+version:        0.3.1
 synopsis:       Optimal ate pairing over Barreto-Naehrig curves
 description:    Optimal ate pairing over Barreto-Naehrig curves
 category:       Cryptography
diff --git a/src/Pairing/Group.hs b/src/Pairing/Group.hs
--- a/src/Pairing/Group.hs
+++ b/src/Pairing/Group.hs
@@ -172,7 +172,7 @@
 instance Arbitrary (Point Fq2) where -- G2
   arbitrary = gMul g2 . abs <$> (arbitrary :: Gen Integer)
 
-hashToG1 :: MonadIO m => ByteString -> m (Maybe G1)
+hashToG1 :: MonadRandom m => ByteString -> m (Maybe G1)
 hashToG1 = swEncBN
 
 randomG1 :: (MonadRandom m) => m G1
diff --git a/src/Pairing/Hash.hs b/src/Pairing/Hash.hs
--- a/src/Pairing/Hash.hs
+++ b/src/Pairing/Hash.hs
@@ -58,7 +58,7 @@
 -- This function evaluates an empty bytestring or one that contains \NUL to zero
 -- which according to Definiton 2 of the paper is sent to an arbitrary point on the curve
 --
-swEncBN :: MonadIO m => ByteString -> m (Maybe (Point Fq))
+swEncBN :: MonadRandom m => ByteString -> m (Maybe (Point Fq))
 swEncBN bs = runMaybeT $ withQM $ \mn -> do
   let t = M.fromBytes bs mn
   sq3 <- hoistMaybe (sqrtOfMinusThree mn)
@@ -71,9 +71,9 @@
     let x2' = x2 mn x1'
     let x3' = x3 mn w'
     let lst = [x1', x2', x3']
-    r1 <- liftIO (randomMod mn)
-    r2 <- liftIO (randomMod mn)
-    r3 <- liftIO (randomMod mn)
+    r1 <- lift $ randomMod mn
+    r2 <- lift $ randomMod mn
+    r3 <- lift $ randomMod mn
     let al = alphaBeta mn r1 x1'
     let bet = alphaBeta mn r2 x2'
     let i' = i al bet
diff --git a/tests/TestGroups.hs b/tests/TestGroups.hs
--- a/tests/TestGroups.hs
+++ b/tests/TestGroups.hs
@@ -88,7 +88,7 @@
 
 prop_hashToG1 :: ByteString -> Property
 prop_hashToG1 bs = TQM.monadicIO $ do
-  toCurveMay <- liftIO (hashToG1 bs)
+  toCurveMay <- TQM.run (hashToG1 bs)
   TQM.assert (isJust toCurveMay)
   let Just toCurve = toCurveMay
   TQM.assert (isOnCurveG1 toCurve)
