diff --git a/RSA.cabal b/RSA.cabal
--- a/RSA.cabal
+++ b/RSA.cabal
@@ -1,6 +1,6 @@
 name:       RSA
 category:   Cryptography, Codec
-version:    1.0.2
+version:    1.0.3
 license:    BSD3
 license-file: LICENSE
 author:     Adam Wick <awick@galois.com>
@@ -17,14 +17,21 @@
              included are based of RFC 3447, or the Public-Key Cryptography
              Standard for RSA, version 2.1 (a.k.a, PKCS#1 v2.1).   
 
+Flag SkipTests
+  Default:     True
+  Description: Skip building the test program
+
 Flag IncludeMD5
   Description: Include support for using MD5 in the various crypto routines.
 
 Flag UseBinary
   Description: Use the binary package for serializing keys.
 
+Flag QuickCheck1
+  Description: Whether this is QuickCheck 1 or not
+
 Library
- build-depends: base >= 3, bytestring, SHA, random
+ build-depends: base >= 3 && < 5, bytestring, SHA, random
  GHC-Options: -O2 -Wall -fno-ignore-asserts -fno-warn-orphans 
  if flag(UseBinary)
    build-depends: binary
@@ -33,12 +40,20 @@
    build-depends: pureMD5
    CPP-Options: -DINCLUDE_MD5
  exposed-modules: Codec.Crypto.RSA
- extensions: CPP, BangPatterns, PatternSignatures
+ extensions: CPP, BangPatterns, ScopedTypeVariables
 
 Executable test_rsa
-    build-depends: base >= 3, bytestring, QuickCheck, SHA >= 1.0.1
+  if flag(SkipTests)
+    Buildable: False
+  else
+    build-depends: base >= 3 && < 5, bytestring, SHA >= 1.0.1
+  if flag(QuickCheck1)
+    build-depends: QuickCheck < 2
+    CPP-Options:   -DQUICKCHECK1
+  else
+    build-depends: QuickCheck >= 2 && < 3
   GHC-Options: -O2 -Wall -fno-ignore-asserts -fno-warn-orphans 
   CPP-Options: -DRSA_TEST
   Main-Is: Test.hs
   Other-Modules: Codec.Crypto.RSA
-  extensions: CPP, BangPatterns, PatternSignatures
+  extensions: CPP, BangPatterns, ScopedTypeVariables
diff --git a/Test.hs b/Test.hs
--- a/Test.hs
+++ b/Test.hs
@@ -3,7 +3,6 @@
 import Data.ByteString.Lazy(ByteString)
 import qualified Data.ByteString.Lazy as BS
 import Data.Digest.Pure.SHA
-import Data.Int
 import Data.Word
 import System.IO
 import System.Random
@@ -17,17 +16,28 @@
 data KeyPair2048 = KP2K PublicKey PrivateKey
  deriving (Show)
 
+getRNGSeed :: Gen StdGen
+#ifdef QUICKCHECK1
+getRNGSeed  = rand
+#else
+getRNGSeed  = fmap mkStdGen arbitrary
+#endif
+
 instance Arbitrary KeyPair where
-  arbitrary   = do g <- rand
+  arbitrary   = do g <- getRNGSeed
                    let (pub, priv, _) = generateKeyPair g 1024
                    return $ KP1K pub priv
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 instance Arbitrary KeyPair2048 where
-  arbitrary   = do g <- rand
+  arbitrary   = do g <- getRNGSeed
                    let (pub, priv, _) = generateKeyPair g 2048
                    return $ KP2K pub priv
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 -- --------------------------------------------------------------------------
 
@@ -37,10 +47,12 @@
   show (LP x) = show x
 
 instance Arbitrary LargePrime where
-  arbitrary   = do g <- rand
+  arbitrary   = do g <- getRNGSeed
                    let (res, _) = large_random_prime g 64
                    return (LP res)
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 -- --------------------------------------------------------------------------
 
@@ -51,7 +63,9 @@
 
 instance Arbitrary PositiveInteger where
   arbitrary   = (PI . (+1) . abs) `fmap` arbitrary
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 -- --------------------------------------------------------------------------
 
@@ -62,15 +76,21 @@
 
 instance Arbitrary Word8 where
   arbitrary   = fromIntegral `fmap` (arbitrary::(Gen Int))
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 instance Arbitrary ByteString where
   arbitrary   = BS.pack `fmap` arbitrary
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 instance Arbitrary NonEmptyByteString where
   arbitrary   = (NEBS . BS.pack) `fmap` (return(:)`ap`arbitrary`ap`arbitrary)
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 -- --------------------------------------------------------------------------
 
@@ -87,14 +107,18 @@
     sha256' = bytestringDigest . sha256
     sha384' = bytestringDigest . sha384
     sha512' = bytestringDigest . sha512
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 instance Show HashInfo where
   show h = "<hash: len=" ++ (show $ BS.length $ hashFunction h BS.empty) ++ ">"
 
 instance Arbitrary HashInfo where
   arbitrary   = elements [ha_SHA1, ha_SHA256, ha_SHA384, ha_SHA512]
+#ifdef QUICKCHECK1
   coarbitrary = undefined
+#endif
 
 -- --------------------------------------------------------------------------
 
