diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+Version 0.4.1.2
+---------------
+* Fixed the doctests using cabal-doctest
+* Fixed a QuickCheck timeout, issue #20
+
 Version 0.4.1.1
 ---------------
 * Fixed the doctests after cabal get
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,2 +1,7 @@
-import Distribution.Simple
-main = defaultMain
+module Main where
+
+import Distribution.Extra.Doctest (defaultMainWithDoctests)
+
+main :: IO ()
+main = defaultMainWithDoctests "doctests"
+
diff --git a/grammatical-parsers.cabal b/grammatical-parsers.cabal
--- a/grammatical-parsers.cabal
+++ b/grammatical-parsers.cabal
@@ -1,5 +1,5 @@
 name:                grammatical-parsers
-version:             0.4.1.1
+version:             0.4.1.2
 synopsis:            parsers that combine into grammars
 description:
   /Gram/matical-/pa/rsers, or Grampa for short, is a library of parser types whose values are meant to be assigned
@@ -14,13 +14,18 @@
 maintainer:          Mario Blažević <blamario@protonmail.com>
 copyright:           (c) 2017 Mario Blažević
 category:            Text, Parsing
-build-type:          Simple
+build-type:          Custom
 cabal-version:       >=1.10
 extra-source-files:  README.md, CHANGELOG.md
 source-repository head
   type:              git
   location:          https://github.com/blamario/grampa
-
+custom-setup
+ setup-depends:
+   base >= 4 && <5,
+   Cabal,
+   cabal-doctest >= 1 && <1.1
+ 
 library
   hs-source-dirs:      src
   exposed-modules:     Text.Grampa,
@@ -75,7 +80,7 @@
   main-is:            Doctest.hs
   other-modules:      README
   ghc-options:        -threaded -pgmL markdown-unlit
-  build-depends:      base, rank2classes, grammatical-parsers, parsers, doctest >= 0.8
+  build-depends:      base, rank2classes, grammatical-parsers, doctest >= 0.8
   build-tool-depends: markdown-unlit:markdown-unlit >= 0.5 && < 0.6
 
 benchmark            benchmarks
diff --git a/test/Doctest.hs b/test/Doctest.hs
--- a/test/Doctest.hs
+++ b/test/Doctest.hs
@@ -1,3 +1,7 @@
-import Test.DocTest
+import Build_doctests (flags, pkgs, module_sources)
+import Test.DocTest (doctest)
 
-main = doctest ["-pgmL", "markdown-unlit", "-isrc", "test/README.lhs"]
+main :: IO ()
+main = do
+    doctest (flags ++ pkgs ++ module_sources)
+    doctest (flags ++ pkgs ++ ["-pgmL", "markdown-unlit", "-isrc", "test/README.lhs"])
diff --git a/test/Test.hs b/test/Test.hs
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -26,7 +26,7 @@
 import Test.Feat.Enumerate (pay)
 import Test.Tasty (TestTree, defaultMain, testGroup)
 import Test.Tasty.QuickCheck (Arbitrary(..), Gen, Positive(..), Property,
-                              (===), (==>), (.&&.), forAll, property, sized, testProperty, within)
+                              (===), (==>), (.&&.), forAll, mapSize, property, sized, testProperty, within)
 import Test.QuickCheck (verbose)
 import Test.QuickCheck.Checkers (Binop, EqProp(..), TestBatch, unbatch)
 import Test.QuickCheck.Classes (functor, monad, monoid, applicative, alternative,
@@ -145,7 +145,7 @@
               testProperty "not not" lookAheadNotNotP,
               testProperty "lookAhead anyToken" lookAheadTokenP],
            testGroup "classes"
-             [testBatch (monoid parser3s),
+             [testBatch (((mapSize (min 10) <$>) <$>) <$> monoid parser3s),
               testBatch (functor parser3s),
               testBatch (applicative parser3s),
               testBatch (alternative parser2s),
@@ -189,7 +189,7 @@
    arbitrary = sized uniform
 
 testBatch :: TestBatch -> TestTree
-testBatch (label, tests) = testGroup label (uncurry testProperty . (within 1000000 <$>) <$> tests)
+testBatch (label, tests) = testGroup label (uncurry testProperty . (within 5000000 <$>) <$> tests)
 
 parser2s :: DescribedParser ([Bool], [Bool]) ([Bool], [Bool])
 parser2s = undefined
