diff --git a/HsOpenSSL.cabal b/HsOpenSSL.cabal
--- a/HsOpenSSL.cabal
+++ b/HsOpenSSL.cabal
@@ -1,12 +1,21 @@
 Name:         HsOpenSSL
 Synopsis:     (Incomplete) OpenSSL binding for Haskell
 Description:
-    HsOpenSSL is an (incomplete) OpenSSL binding for Haskell. It can
-    generate RSA and DSA keys, read and write PEM files, generate
-    message digests, sign and verify messages, encrypt and decrypt
-    messages. It has also some capabilities of creating SSL clients
-    and servers.
-Version:       0.10.1.2
+    .
+    HsOpenSSL is an OpenSSL binding for Haskell. It can generate RSA
+    and DSA keys, read and write PEM files, generate message digests,
+    sign and verify messages, encrypt and decrypt messages. It has
+    also some capabilities of creating SSL clients and servers.
+    .
+    Please note that this project has started at the time when there
+    were no pure-Haskell implementations of TLS. Now there is tls
+    package (<http://hackage.haskell.org/package/tls>), which looks
+    pretty saner than HsOpenSSL especially for initialisation and
+    error handlings. So PHO (the initial author of HsOpenSSL) highly
+    recommends you to use and improve the tls package instead of this
+    as long as possible.
+    .
+Version:       0.10.1.3
 License:       PublicDomain
 License-File:  COPYING
 Author:        Adam Langley, Mikhail Vorozhtsov, PHO, Taru Karttunen
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,17 @@
 -*- coding: utf-8 -*-
 
+Changes from 0.10.1.2 to 0.10.1.3
+---------------------------------
+* OpenSSL.Session:
+  - SSL, SSLContext, SSLResult, ShutdownType and VerificationMode are
+    now instances of Typeable.
+
+* Applied a series of patches "Various fixes for GHC 7.5" by Ben Gamari:
+  - Use unsafeForeignPtrToPtr from Foreign.ForeignPtr.Unsafe
+  - Use unsafePerformIO from System.IO.Unsafe
+  - Add Num to constraints with Bits
+
+
 Changes from 0.10.1.1 to 0.10.1.2
 ---------------------------------
 * Applied a patch by Mikhail Vorozhtsov:
diff --git a/OpenSSL/BN.hsc b/OpenSSL/BN.hsc
--- a/OpenSSL/BN.hsc
+++ b/OpenSSL/BN.hsc
@@ -43,9 +43,12 @@
     where
 
 import           Control.Exception hiding (try)
-import           Foreign
 import qualified Data.ByteString as BS
+import           Foreign.Marshal
+import           Foreign.Ptr
+import           Foreign.Storable
 import           OpenSSL.Utils
+import           System.IO.Unsafe
 
 #ifndef __GLASGOW_HASKELL__
 import           Control.Monad
diff --git a/OpenSSL/DSA.hsc b/OpenSSL/DSA.hsc
--- a/OpenSSL/DSA.hsc
+++ b/OpenSSL/DSA.hsc
@@ -34,7 +34,8 @@
 import           Control.Monad
 import qualified Data.ByteString as BS
 import           Data.Typeable
-import           Foreign
+import           Foreign hiding (unsafePerformIO)
+import           System.IO.Unsafe (unsafePerformIO)
 import           Foreign.C (CString)
 import           Foreign.C.Types
 import           OpenSSL.BN
diff --git a/OpenSSL/EVP/Base64.hsc b/OpenSSL/EVP/Base64.hsc
--- a/OpenSSL/EVP/Base64.hsc
+++ b/OpenSSL/EVP/Base64.hsc
@@ -22,8 +22,9 @@
 import qualified Data.ByteString.Char8 as B8
 import qualified Data.ByteString.Lazy.Char8 as L8
 import           Data.List
-import           Foreign
+import           Foreign hiding (unsafePerformIO)
 import           Foreign.C
+import           System.IO.Unsafe (unsafePerformIO)
 
 
 -- On encoding, we keep fetching the next block until we get at least
diff --git a/OpenSSL/EVP/Digest.hsc b/OpenSSL/EVP/Digest.hsc
--- a/OpenSSL/EVP/Digest.hsc
+++ b/OpenSSL/EVP/Digest.hsc
@@ -24,7 +24,8 @@
 import qualified Data.ByteString.Char8 as B8
 import qualified Data.ByteString.Lazy.Char8 as L8
 import           Control.Applicative ((<$>))
-import           Foreign
+import           Foreign hiding (unsafePerformIO)
+import           System.IO.Unsafe (unsafePerformIO)
 import           Foreign.C
 import           OpenSSL.EVP.Internal
 import           OpenSSL.Objects
diff --git a/OpenSSL/EVP/Internal.hsc b/OpenSSL/EVP/Internal.hsc
--- a/OpenSSL/EVP/Internal.hsc
+++ b/OpenSSL/EVP/Internal.hsc
@@ -61,7 +61,8 @@
 import Foreign.C.String (peekCStringLen)
 import Foreign.ForeignPtr (
          ForeignPtr, newForeignPtr, withForeignPtr, addForeignPtrFinalizer,
-         mallocForeignPtrBytes, touchForeignPtr, unsafeForeignPtrToPtr)
+         mallocForeignPtrBytes, touchForeignPtr)
+import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
 import Foreign.Storable (Storable(..))
 import Foreign.Marshal.Alloc (alloca, allocaBytes)
 import Foreign.Marshal.Array (allocaArray)
diff --git a/OpenSSL/EVP/Open.hsc b/OpenSSL/EVP/Open.hsc
--- a/OpenSSL/EVP/Open.hsc
+++ b/OpenSSL/EVP/Open.hsc
@@ -12,7 +12,8 @@
 
 import qualified Data.ByteString.Char8 as B8
 import qualified Data.ByteString.Lazy.Char8 as L8
-import           Foreign
+import           Foreign hiding (unsafePerformIO)
+import           System.IO.Unsafe (unsafePerformIO)
 import           Foreign.C
 import           OpenSSL.EVP.Cipher hiding (cipher)
 import           OpenSSL.EVP.PKey
diff --git a/OpenSSL/RSA.hsc b/OpenSSL/RSA.hsc
--- a/OpenSSL/RSA.hsc
+++ b/OpenSSL/RSA.hsc
@@ -32,7 +32,8 @@
 
 import           Control.Monad
 import           Data.Typeable
-import           Foreign
+import           Foreign hiding (unsafePerformIO)
+import           System.IO.Unsafe (unsafePerformIO)
 import           Foreign.C
 import           OpenSSL.BN
 import           OpenSSL.Utils
diff --git a/OpenSSL/Session.hsc b/OpenSSL/Session.hsc
--- a/OpenSSL/Session.hsc
+++ b/OpenSSL/Session.hsc
@@ -102,6 +102,7 @@
                              , ctxPtr  :: ForeignPtr SSLContext_
                              , ctxVfCb :: IORef (Maybe (FunPtr VerifyCb))
                              }
+                deriving Typeable
 
 data SSLMethod_
 
@@ -212,6 +213,7 @@
                         , vpClientOnce       :: Bool  -- ^ only request once per connection
                         , vpCallback         :: Maybe (Bool -> X509StoreCtx -> IO Bool) -- ^ optional callback
                         }
+                      deriving Typeable
 
 foreign import ccall unsafe "SSL_CTX_set_verify"
    _ssl_set_verify_mode :: Ptr SSLContext_ -> CInt -> FunPtr VerifyCb -> IO ()
@@ -286,6 +288,7 @@
                , sslFd     :: Fd -- ^ Get the underlying socket Fd
                , sslSocket :: Maybe Socket -- ^ Get the socket underlying an SSL connection
                }
+           deriving Typeable
 
 foreign import ccall unsafe "SSL_new" _ssl_new :: Ptr SSLContext_ -> IO (Ptr SSL_)
 foreign import ccall unsafe "&SSL_free" _ssl_free :: FunPtr (Ptr SSL_ -> IO ())
@@ -342,7 +345,7 @@
 data SSLResult a = SSLDone a  -- ^ operation finished successfully
                  | WantRead   -- ^ needs more data from the network
                  | WantWrite  -- ^ needs more outgoing buffer space
-                 deriving (Eq, Show, Functor, Foldable, Traversable)
+                 deriving (Eq, Show, Functor, Foldable, Traversable, Typeable)
 
 -- | Block until the operation is finished.
 sslBlock :: (SSL -> IO (SSLResult a)) -> SSL -> IO a
@@ -490,7 +493,7 @@
 
 data ShutdownType = Bidirectional  -- ^ wait for the peer to also shutdown
                   | Unidirectional  -- ^ only send our shutdown
-                    deriving (Eq, Show)
+                  deriving (Eq, Show, Typeable)
 
 -- | Cleanly shutdown an SSL connection. Note that SSL has a concept of a
 --   secure shutdown, which is distinct from just closing the TCP connection.
diff --git a/OpenSSL/Utils.hs b/OpenSSL/Utils.hs
--- a/OpenSSL/Utils.hs
+++ b/OpenSSL/Utils.hs
@@ -45,7 +45,7 @@
 raiseOpenSSLError = getError >>= errorString >>= fail
 
 -- | Convert an integer to a hex string
-toHex :: (Bits i) => i -> String
+toHex :: (Num i, Bits i) => i -> String
 toHex = reverse . map hexByte . unfoldr step where
   step 0 = Nothing
   step i = Just (i .&. 0xf, i `shiftR` 4)
@@ -69,7 +69,7 @@
   hexByte _  = undefined
 
 -- | Convert a hex string to an integer
-fromHex :: (Bits i) => String -> i
+fromHex :: (Num i, Bits i) => String -> i
 fromHex = foldl step 0 where
   step acc hexchar = (acc `shiftL` 4) .|. byteHex hexchar
 
diff --git a/OpenSSL/X509.hsc b/OpenSSL/X509.hsc
--- a/OpenSSL/X509.hsc
+++ b/OpenSSL/X509.hsc
@@ -53,7 +53,8 @@
 import           Control.Monad
 import           Data.Time.Clock
 import           Data.Maybe
-import           Foreign
+import           Foreign hiding (unsafeForeignPtrToPtr)
+import           Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
 import           Foreign.C
 import           OpenSSL.ASN1
 import           OpenSSL.BIO
