diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,11 @@
 # Changelog for keep-alive
 
+## 0.1.1.0
+
+- Fix build errors
+
+## 0.2.0.0
+
+- add return code to OTHER_KEEPALIVE_ERROR
+
 ## Unreleased changes
diff --git a/cbits/CKa.c b/cbits/CKa.c
new file mode 100644
--- /dev/null
+++ b/cbits/CKa.c
@@ -0,0 +1,3 @@
+#define INLINE
+#include "CKa.h"
+
diff --git a/cbits/Cka.c b/cbits/Cka.c
deleted file mode 100644
--- a/cbits/Cka.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define INLINE
-#include "CKa.h"
-
diff --git a/keep-alive.cabal b/keep-alive.cabal
--- a/keep-alive.cabal
+++ b/keep-alive.cabal
@@ -1,13 +1,7 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.33.0.
---
--- see: https://github.com/sol/hpack
---
--- hash: e4fadd87f6fc7f6bca702c40ec776acd3dc1b4562423d193979808778831f6b8
-
 name:           keep-alive
-version:        0.1.1.0
+version:        0.2.0.0
 homepage:       https://github.com/3kyro/keep-alive#readme
 bug-reports:    https://github.com/3kyro/keep-alive/issues
 author:         Kyriakos Papachrysanthou
@@ -41,10 +35,10 @@
   hs-source-dirs:
       src
   build-depends:
-      base >=4.7 && <5
+      base >=4.9 && <5
   include-dirs:
       cbits/
-  c-sources: cbits/Cka.c
+  c-sources: cbits/CKa.c
   default-language: Haskell2010
 
 test-suite keep-alive-test
@@ -54,7 +48,7 @@
       Paths_keep_alive
   hs-source-dirs:
       test
-  ghc-options: -threaded -rtsopts -with-rtsopts=-N
+  ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs
   build-depends:
       base >=4.7 && <5
     , keep-alive
diff --git a/src/LibForeign.hsc b/src/LibForeign.hsc
--- a/src/LibForeign.hsc
+++ b/src/LibForeign.hsc
@@ -1,9 +1,9 @@
 {-# LANGUAGE CPP,  ForeignFunctionInterface #-}
 module LibForeign where
 
-import Foreign
-import Foreign.C.Types
-import Foreign.C.Error
+import Foreign (Ptr, alloca, peek, sizeOf, with)
+import Foreign.C.Types (CInt (..))
+import Foreign.C.Error (Errno (..), getErrno)
 import Data.Word (Word32)
 
 -- Platform specific includes
diff --git a/src/Network/Socket/KeepAlive.hs b/src/Network/Socket/KeepAlive.hs
--- a/src/Network/Socket/KeepAlive.hs
+++ b/src/Network/Socket/KeepAlive.hs
@@ -31,10 +31,9 @@
     , getKeepAliveOnOff
     ) where
 
-import           Data.Word  (Word32)
-import           Foreign
-import           Foreign.C
-import           LibForeign
+import           Foreign    (Word32)
+import           Foreign.C  (CInt)
+import           LibForeign (getKeepAliveOnOff_, setKeepAlive_)
 
 
 -- | The main data structure defining keep alive parameters
@@ -49,7 +48,8 @@
     deriving (Show, Eq, Ord)
 
 -- | Errors starting with WSA are windows specific
-data KeepAliveError = WSA_IO_PENDING
+data KeepAliveError
+    = WSA_IO_PENDING
     | WSA_OPERATION_ABORTED
     | WSAEFAULT
     | WSAEINPROGRESS
@@ -67,7 +67,7 @@
     | ENOTSOCK
     | ENOMEM
     | ENOBUFS
-    | OTHER_KEEPALIVE_ERROR
+    | OTHER_KEEPALIVE_ERROR CInt
     deriving (Show, Eq, Ord)
 
 -- | Set keep alive parameters for the current socket
@@ -99,7 +99,7 @@
         88    -> Left ENOTSOCK
         12    -> Left ENOMEM
         105   -> Left ENOBUFS
-        _     -> Left OTHER_KEEPALIVE_ERROR
+        other -> Left $ OTHER_KEEPALIVE_ERROR other
 
 -- | Returns True if keep alive is active for the specified socket
 getKeepAliveOnOff ::
@@ -107,9 +107,9 @@
     -- ^ Socket file descriptor
     -> IO Bool
 getKeepAliveOnOff fd =
-    cToBool . fromInteger . toInteger <$> getKeepAliveOnOff_ fd
+    cToBool <$> getKeepAliveOnOff_ fd
 
-cToBool :: Int -> Bool
+cToBool :: CInt -> Bool
 cToBool x
     | x == 0 = False
     | otherwise = True
