diff --git a/avers.cabal b/avers.cabal
--- a/avers.cabal
+++ b/avers.cabal
@@ -1,5 +1,5 @@
 name:                avers
-version:             0.0.3
+version:             0.0.4
 license:             GPL-3
 license-file:        LICENSE
 author:              Tomas Carnecky
@@ -12,12 +12,17 @@
 description:         empty
 
 
+source-repository head
+    type:     git
+    location: git://github.com/wereHamster/avers-haskell.git
+
+
 library
     hs-source-dirs:   src
     default-language: Haskell2010
 
     ghc-options:
-        -threaded -Wall
+        -Wall
 
 
     -- For the time being everything is exported.
diff --git a/src/Avers/TH.hs b/src/Avers/TH.hs
--- a/src/Avers/TH.hs
+++ b/src/Avers/TH.hs
@@ -34,6 +34,7 @@
 import           Database.RethinkDB (toDatum, FromDatum(..))
 import           Database.RethinkDB.TH
 
+import           Prelude
 
 
 dropPrefix :: String -> String -> String
@@ -106,8 +107,9 @@
             "Avers.TH.deriveFromJSONWithDefaults: default " ++
             "specified for " ++ show name ++ " but this field does not exist."
 
+    icxt <- mapM (\tv -> classP ''FromJSON [varT tv]) tyVars
     return
-        [ InstanceD [ClassP ''FromJSON [VarT tv] | tv <- tyVars]
+        [ InstanceD icxt
             (AppT fromJsonT (mkAppTys (typeT : map VarT tyVars)))
             [ FunD 'parseJSON
                 [ Clause [VarP xN]
@@ -167,8 +169,9 @@
             "Avers.TH.deriveFromDatumWithDefaults: default " ++
             "specified for " ++ show name ++ " but this field does not exist."
 
+    icxt <- mapM (\tv -> classP ''FromDatum [varT tv]) tyVars
     return
-        [ InstanceD [ClassP ''FromDatum [VarT tv] | tv <- tyVars]
+        [ InstanceD icxt
             (AppT fromDatumT (mkAppTys (typeT : map VarT tyVars)))
             [ FunD 'parseDatum
                 [ Clause [VarP xN]
