diff --git a/gnutls.cabal b/gnutls.cabal
--- a/gnutls.cabal
+++ b/gnutls.cabal
@@ -1,5 +1,5 @@
 name: gnutls
-version: 0.3
+version: 0.3.1
 license: GPL-3
 license-file: license.txt
 author: John Millikin <jmillikin@gmail.com>
@@ -26,7 +26,7 @@
 source-repository this
   type: git
   location: https://git.singpolyma.net/haskell-gnutls
-  tag: 0.3
+  tag: 0.3.1
 
 library
   default-language: Haskell2010
diff --git a/lib/Network/Protocol/TLS/GNU/Foreign.chs b/lib/Network/Protocol/TLS/GNU/Foreign.chs
--- a/lib/Network/Protocol/TLS/GNU/Foreign.chs
+++ b/lib/Network/Protocol/TLS/GNU/Foreign.chs
@@ -21,6 +21,7 @@
 
 import           Foreign
 import           Foreign.C
+import           System.Posix.Types
 
 -- Type aliases {{{
 
@@ -224,13 +225,13 @@
 	gnutls_record_get_max_size :: Session -> IO CSize
 
 foreign import ccall safe "gnutls_record_recv"
-	gnutls_record_recv :: Session -> Ptr a -> CSize -> IO CSize
+	gnutls_record_recv :: Session -> Ptr a -> CSize -> IO CSsize
 
 foreign import ccall safe "gnutls_record_send"
-	gnutls_record_send :: Session -> Ptr a -> CSize -> IO CSize
+	gnutls_record_send :: Session -> Ptr a -> CSize -> IO CSsize
 
 foreign import ccall safe "gnutls_record_set_max_size"
-	gnutls_record_set_max_size :: Session -> CSize -> IO CSize
+	gnutls_record_set_max_size :: Session -> CSize -> IO CSsize
 
 -- }}}
 
