diff --git a/Database/Persist/Redis/Config.hs b/Database/Persist/Redis/Config.hs
--- a/Database/Persist/Redis/Config.hs
+++ b/Database/Persist/Redis/Config.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE RankNTypes, TypeFamilies, GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE OverloadedStrings #-}
@@ -29,7 +30,11 @@
 import Control.Monad.Reader(ReaderT(..))
 import Control.Monad.Reader.Class
 import qualified Data.ByteString.Char8 as B
+#if MIN_VERSION_aeson(0, 7, 0)
+import Data.Scientific() -- we require only RealFrac instance of Scientific
+#else
 import Data.Attoparsec.Number
+#endif
 
 newtype RedisAuth =  RedisAuth Text deriving (Eq, Show)
 
@@ -42,7 +47,7 @@
 } deriving (Show)
 
 instance FromJSON R.PortID where
-    parseJSON (Number (I x)) = (return . R.PortNumber . fromInteger) x
+    parseJSON (Number x) = (return . R.PortNumber . fromInteger . truncate) x
     parseJSON _ = fail "couldn't parse port number"
 
 instance FromJSON RedisAuth where
diff --git a/persistent-redis.cabal b/persistent-redis.cabal
--- a/persistent-redis.cabal
+++ b/persistent-redis.cabal
@@ -1,5 +1,5 @@
 name:            persistent-redis
-version:         0.2.1
+version:         0.2.2
 license:         BSD3
 license-file:    LICENSE
 author:          Pavel Ryzhov <paul@paulrz.cz>
@@ -29,6 +29,7 @@
                    , monad-control         >= 0.3.2.0  && < 0.3.3.0
                    , utf8-string           >= 0.3.7    && < 0.4.0
                    , binary                >= 0.7      && < 0.8
+                   , scientific
 
     exposed-modules: Database.Persist.Redis
 
