diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,9 +1,11 @@
-import Distribution.Simple
-import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(withPrograms), buildDir)
-import Distribution.Simple.Program (userSpecifyArgs)
+import           Control.Exception
+import           Distribution.Simple
+import           Distribution.Simple.LocalBuildInfo (LocalBuildInfo (withPrograms),
+                                                     buildDir)
+import           Distribution.Simple.Program        (userSpecifyArgs)
 
-import System.Directory
-import System.FilePath
+import           System.Directory
+import           System.FilePath
 
 -- Define __HADDOCK__ when building documentation.
 main = defaultMainWithHooks simpleUserHooks {
@@ -19,4 +21,4 @@
 removePreProcessedFiles dir = do
   putStrLn $ "Trying to remove source in: " ++ dir
   removeFile (dir </> "System/BSD/Sysctl.hs")
-    `catch` \_ -> putStrLn "Could not find source file!" >> return ()
+    `catch` ((\_ -> putStrLn "Could not find source file!") :: IOException -> IO ()) >> return ()
diff --git a/System/BSD/Sysctl.hsc b/System/BSD/Sysctl.hsc
--- a/System/BSD/Sysctl.hsc
+++ b/System/BSD/Sysctl.hsc
@@ -6,7 +6,7 @@
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.BSD.Sysctl
--- Copyright   :  (c) Maxime Henrion 2009
+-- Copyright   :  (c) Maxime Henrion 2009-2010
 -- License     :  see LICENSE
 --
 -- Maintainer  :  mhenrion@gmail.com
@@ -43,36 +43,36 @@
 
   -- * OID creation and extraction
 #ifdef HAVE_SYSCTLNAMETOMIB
-  sysctlNameToOid,	-- :: String -> IO OID
-  sysctlNameToOidArgs,	-- :: String -> [#{type int}] -> IO OID
+  sysctlNameToOid,      -- :: String -> IO OID
+  sysctlNameToOidArgs,  -- :: String -> [#{type int}] -> IO OID
 #endif
-  sysctlPrepareOid,	-- :: [#{type int}] -> IO OID
-  sysctlExtractOid,	-- :: OID -> IO [#{type int}]
+  sysctlPrepareOid,     -- :: [#{type int}] -> IO OID
+  sysctlExtractOid,     -- :: OID -> IO [#{type int}]
 
   -- * Basic reading functions
-  sysctlReadInt,	-- :: SysctlKey k => k -> IO #{type int}
-  sysctlReadUInt,	-- :: SysctlKey k => k -> IO #{type unsigned int}
-  sysctlReadLong,	-- :: SysctlKey k => k -> IO #{type long}
-  sysctlReadULong,	-- :: SysctlKey k => k -> IO #{type unsigned long}
-  sysctlReadQuad,	-- :: SysctlKey k => k -> IO Int64
-  sysctlReadUQuad,	-- :: SysctlKey k => k -> IO Word64
-  sysctlReadString,	-- :: SysctlKey k => k -> IO String
+  sysctlReadInt,        -- :: SysctlKey k => k -> IO #{type int}
+  sysctlReadUInt,       -- :: SysctlKey k => k -> IO #{type unsigned int}
+  sysctlReadLong,       -- :: SysctlKey k => k -> IO #{type long}
+  sysctlReadULong,      -- :: SysctlKey k => k -> IO #{type unsigned long}
+  sysctlReadQuad,       -- :: SysctlKey k => k -> IO Int64
+  sysctlReadUQuad,      -- :: SysctlKey k => k -> IO Word64
+  sysctlReadString,     -- :: SysctlKey k => k -> IO String
 
   -- * Advanced reading functions
-  sysctlPeek,		-- :: forall k a. (SysctlKey k, Storable a) => k -> IO a
-  sysctlPeekArray,	-- :: forall k a. (SysctlKey k, Storable a) => k -> IO [a]
+  sysctlPeek,           -- :: forall k a. (SysctlKey k, Storable a) => k -> IO a
+  sysctlPeekArray,      -- :: forall k a. (SysctlKey k, Storable a) => k -> IO [a]
 
   -- * Basic writing functions
-  sysctlWriteInt,	-- :: SysctlKey k => k -> #{type int} -> IO ()
-  sysctlWriteUInt,	-- :: SysctlKey k => k -> #{type unsigned int} -> IO ()
-  sysctlWriteLong,	-- :: SysctlKey k => k -> #{type long} -> IO ()
-  sysctlWriteULong,	-- :: SysctlKey k => k -> #{type unsigned long} -> IO ()
-  sysctlWriteQuad,	-- :: SysctlKey k => k -> Int64 -> IO ()
-  sysctlWriteUQuad,	-- :: SysctlKey k => k -> Word64 -> IO ()
-  sysctlWriteString,	-- :: SysctlKey k => k -> String -> IO ()
+  sysctlWriteInt,       -- :: SysctlKey k => k -> #{type int} -> IO ()
+  sysctlWriteUInt,      -- :: SysctlKey k => k -> #{type unsigned int} -> IO ()
+  sysctlWriteLong,      -- :: SysctlKey k => k -> #{type long} -> IO ()
+  sysctlWriteULong,     -- :: SysctlKey k => k -> #{type unsigned long} -> IO ()
+  sysctlWriteQuad,      -- :: SysctlKey k => k -> Int64 -> IO ()
+  sysctlWriteUQuad,     -- :: SysctlKey k => k -> Word64 -> IO ()
+  sysctlWriteString,    -- :: SysctlKey k => k -> String -> IO ()
 
   -- * Advanced writing functions
-  sysctlPoke		-- :: (SysctlKey k, Storable a) => k -> a -> IO ()
+  sysctlPoke            -- :: (SysctlKey k, Storable a) => k -> a -> IO ()
   ) where
 
 import Control.Arrow (second)
@@ -226,7 +226,7 @@
 sysctlReadDynamic key scale f =
   withKey key $ \oid len -> do
     size <- sysctlGetSize oid len
-    let bufSize = scale size	-- Allows to make room for lists of variable length
+    let bufSize = scale size  -- Allows to make room for lists of variable length
     allocaBytes (fromIntegral bufSize) $ \buf ->
       sysctlRead oid len buf bufSize f
 
diff --git a/bsd-sysctl.cabal b/bsd-sysctl.cabal
--- a/bsd-sysctl.cabal
+++ b/bsd-sysctl.cabal
@@ -1,32 +1,39 @@
-Name:		bsd-sysctl
-Version:	1.0.7
-License-File:	LICENSE
-License:	BSD3
-Author:		Maxime Henrion
-Copyright:	2009-2010, Maxime Henrion
-Maintainer:	Maxime Henrion <mhenrion@gmail.com>
-Bug-Reports:	http://bitbucket.org/mux/bsd-sysctl/issues/
-Category:	System, BSD
-Synopsis:	Access to the BSD sysctl(3) interface
-Description:
+name:                bsd-sysctl
+version:             1.0.8.0
+license-File:        LICENSE
+license:             BSD3
+author:              Maxime Henrion
+copyright:           2009-2010, Maxime Henrion
+maintainer:          Alexei Pastuchov <info@maximka.de>
+bug-reports:         https://github.com:p-alik/bsd-sysctl/issues
+homepage:            https://github.com:p-alik/bsd-sysctl
+category:            System, BSD
+synopsis:            Access to the BSD sysctl(3) interface
+description:
   This module provides efficient access to the BSD sysctl(3) interface via the
   Haskell FFI.
   .
   It allows to read and write both basic sysctl types, as well as complex opaque
   types (typically C structures) described via Storable instances.
-Build-Type:	Custom
-Cabal-Version:	>= 1.6
-Tested-with:	GHC ==6.10, GHC ==6.12
-Extra-Source-Files:
-  demo/Demo.hsc demo/demo.cabal demo/demo.output demo/Setup.hs
+build-type:          Simple
+cabal-version:       >=1.10
+tested-with:         GHC ==6.10
+                   , GHC ==6.12
+                   , GHC ==7.8.4
+                   , GHC ==7.10.3
+                   , GHC ==8.0.2
+extra-source-files:
+  demo/Demo.hsc
+  demo/Setup.hs
+  demo/demo.cabal
 
-Source-Repository head
-  Type:			mercurial
-  Location:		http://bitbucket.org/mux/bsd-sysctl/
+library
+  build-depends:       base >= 4.7 && < 5
+  exposed-modules:     System.BSD.Sysctl
+  ghc-options:         -Wall -O2 -funbox-strict-fields
+  default-language:    Haskell2010
 
-Library
-  Build-Depends:	base >= 3 && < 5
-  Exposed-Modules:	System.BSD.Sysctl
-  Extensions:		ForeignFunctionInterface, ScopedTypeVariables,
-                        TypeSynonymInstances, FlexibleInstances
-  GHC-Options:		-Wall -O2 -funbox-strict-fields
+source-repository head
+  type:     git
+  location: https://github.com:p-alik/bsd-sysctl
+
diff --git a/demo/demo.cabal b/demo/demo.cabal
--- a/demo/demo.cabal
+++ b/demo/demo.cabal
@@ -1,6 +1,7 @@
-Name: demo
-Version: 0.0
-Build-Depends: base >= 3 && < 5, bsd-sysctl
-Build-Type: Simple
-Executable: demo
-Main-is: Demo.hs
+name:                demo
+version:             0.0
+Build-Depends:       base >= 3 && < 5,
+                     bsd-sysctl
+build-type:          Simple
+executable:          demo
+main-is:             Demo.hs
diff --git a/demo/demo.output b/demo/demo.output
deleted file mode 100644
--- a/demo/demo.output
+++ /dev/null
@@ -1,14 +0,0 @@
-kern.osrelease: 7.2-PRERELEASE
-kern.boottime: { usec = 1241115805, usec = 736670 }
-kern.maxfiles: 32768
-kern.lastpid: 90199
-vfs.numvnodes: 45973
-net.inet.tcp.recvspace: 65536
-PID	UID	COMMAND
-90199	1001	demo
-89970	1001	vim
-89593	1001	zsh
-87861	1001	screen
-87841	1001	ssh
-[...lots of lines removed...]
-test: sysctl: permission denied (Operation not permitted)
