diff --git a/library/PostgreSQL/Binary/Encoder.hs b/library/PostgreSQL/Binary/Encoder.hs
--- a/library/PostgreSQL/Binary/Encoder.hs
+++ b/library/PostgreSQL/Binary/Encoder.hs
@@ -425,7 +425,7 @@
   dimensionsLength <> nulls <> oid <> dimensions <> values
   where
     dimensionsLength = 
-      int4_word32 $ fromIntegral $ length dimensionsV
+      int4_word32 $ fromIntegral $ Vector.length dimensionsV
     nulls = 
       int4_word32 $ if nullsV then 1 else 0
     oid = 
diff --git a/library/PostgreSQL/Binary/Prelude.hs b/library/PostgreSQL/Binary/Prelude.hs
--- a/library/PostgreSQL/Binary/Prelude.hs
+++ b/library/PostgreSQL/Binary/Prelude.hs
@@ -91,4 +91,4 @@
 
 joinMap :: Monad m => (a -> m b) -> m a -> m b
 joinMap f =
-  join . fmap f
+  join . liftM f
diff --git a/postgresql-binary.cabal b/postgresql-binary.cabal
--- a/postgresql-binary.cabal
+++ b/postgresql-binary.cabal
@@ -1,7 +1,7 @@
 name:
   postgresql-binary
 version:
-  0.7.4
+  0.7.4.1
 synopsis:
   Encoders and decoders for the PostgreSQL's binary format
 description:
@@ -15,7 +15,7 @@
   and is tested against 8.3, 9.3 and 9.4
   with the @integer_datetimes@ setting off and on.
 category:
-  Database, Codecs, Parsing
+  PostgreSQL, Database, Codecs, Parsing
 homepage:
   https://github.com/nikita-volkov/postgresql-binary 
 bug-reports:
diff --git a/tasty/Main/Apx.hs b/tasty/Main/Apx.hs
--- a/tasty/Main/Apx.hs
+++ b/tasty/Main/Apx.hs
@@ -17,36 +17,53 @@
 
 instance Eq (Apx LocalTime) where
   (==) (Apx a) (Apx b) =
-    localTimeRep a == localTimeRep b
+    Apx (localTimeToSeconds a) ==
+    Apx (localTimeToSeconds b)
 
 instance Eq (Apx UTCTime) where
   (==) (Apx a) (Apx b) =
-    utcTimeApxRep a == utcTimeApxRep b
+    Apx (utcTimeToSeconds a) ==
+    Apx (utcTimeToSeconds b)
 
 instance Eq (Apx TimeOfDay) where
   (==) (Apx a) (Apx b) =
-    timeOfDayApxRep a == timeOfDayApxRep b
+    Apx (timeOfDayToSeconds a) ==
+    Apx (timeOfDayToSeconds b)
 
 instance Eq (Apx TimeZone) where
   (==) (Apx a) (Apx b) =
     a == b
 
+instance Eq (Apx Double) where
+  (==) (Apx a) (Apx b) =
+    toRational a == toRational b
 
-utcTimeApxRep (UTCTime d d') =
-  (d, picoApxRep (unsafeCoerce d'))
+instance Eq (Apx Rational) where
+  (==) (Apx a) (Apx b) =
+    a + error >= b &&
+    a - error <= b
+    where
+      error =
+        10 ^^ negate 3
 
-localTimeRep (LocalTime d t) =
-  (d, timeOfDayApxRep t)
 
-timetzApxRep (t, tz) = 
-  (timeOfDayApxRep t, tz)
+utcTimeToSeconds :: UTCTime -> Rational
+utcTimeToSeconds (UTCTime days diffTime) =
+  dayToSeconds days + diffTimeToSeconds diffTime
 
-timeOfDayApxRep :: TimeOfDay -> (Int, Int, Integer)
-timeOfDayApxRep (TimeOfDay h m s) =
-  (h, m, picoApxRep s)
+diffTimeToSeconds :: DiffTime -> Rational
+diffTimeToSeconds diffTime =
+  unsafeCoerce diffTime % (10 ^ 12)
 
-picoApxRep :: Pico -> Integer
-picoApxRep s =
-  let p = unsafeCoerce s :: Integer
-      in floor (p % 10^6)
+dayToSeconds :: Day -> Rational
+dayToSeconds (ModifiedJulianDay day) =
+  (unsafeCoerce day * 24 * 60 * 60) % 1
 
+localTimeToSeconds :: LocalTime -> Rational
+localTimeToSeconds (LocalTime day tod) =
+  dayToSeconds day +
+  timeOfDayToSeconds tod
+
+timeOfDayToSeconds :: TimeOfDay -> Rational
+timeOfDayToSeconds (TimeOfDay h m s) =
+  ((toInteger h * 60 + toInteger m) * 60) % 1 + unsafeCoerce s % (10 ^ 12)
diff --git a/tasty/Main/Prelude.hs b/tasty/Main/Prelude.hs
--- a/tasty/Main/Prelude.hs
+++ b/tasty/Main/Prelude.hs
@@ -97,4 +97,4 @@
 
 joinMap :: Monad m => (a -> m b) -> m a -> m b
 joinMap f =
-  join . fmap f
+  join . liftM f
