diff --git a/binary-shared.cabal b/binary-shared.cabal
--- a/binary-shared.cabal
+++ b/binary-shared.cabal
@@ -1,12 +1,12 @@
 name: binary-shared
-version: 0.8.1
+version: 0.8.2
 cabal-version: -any
 build-type: Simple
 license: GPL
 license-file: LICENSE
 copyright: Juergen Nicklisch-Franken (jutaro)
 maintainer: maintainer@leksah.org
-build-depends: base >=4.0.0.0 && <5.0.0.0, binary >=0.5,
+build-depends: base >=4.5.0.0 && <5.0.0.0, binary >=0.5,
                bytestring >=0.9.1.4, containers >=0.2.0.0, mtl >=1.1.0.2
 homepage: http://www.leksah.org
 package-url: http://code.haskell.org/binary-shared
diff --git a/src/Data/Binary/Shared.hs b/src/Data/Binary/Shared.hs
--- a/src/Data/Binary/Shared.hs
+++ b/src/Data/Binary/Shared.hs
@@ -106,8 +106,7 @@
 
 instance Ord Object where
     compare (ObjC a) (ObjC b) = if typeOf a /= typeOf b
-                                then compare ((unsafePerformIO . typeRepKey . typeOf) a)
-                                                ((unsafePerformIO . typeRepKey . typeOf) b)
+                                then compare (typeOf a) (typeOf b)
                                 else compare (Just a) (cast b)
 
 type PutShared = St.StateT (Map Object Int, Int) PutM ()
