diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+Hopfli - Haskell bindings to the Zopfli library
+===
+[![Build Status](https://secure.travis-ci.org/ananthakumaran/hopfli.png)](http://travis-ci.org/ananthakumaran/hopfli)
+[![Hackage-Deps](https://img.shields.io/hackage-deps/v/hopfli.svg)](http://packdeps.haskellers.com/specific?package=hasmin)
+[![Hackage](https://img.shields.io/hackage/v/hopfli.svg)](https://hackage.haskell.org/package/hopfli)
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
+
+Hopfli provides a pure interface to compress data using the Zopfli library.
+
+*Zopfli is a compression library released by Google in 2013, which can output
+either a raw DEFLATE stream, or one wrapped into zlib or gzip formats. Under
+default settings, the output produced by Zopfli is 3.7–8.3% smaller than that of
+`gzip -9`, though the algorithm is 81 times slower.*
+
+## Example
+
+````haskell
+import           Codec.Compression.Hopfli
+import           Data.ByteString
+import           System.IO                (stdin, stdout)
+
+main :: IO ()
+main = hGetContents stdin >>= hPut stdout . compressWith defaultCompressOptions GZIP
+````
+
+````
+runGhc example.hs < README.md > README.md.gz
+````
diff --git a/hopfli.cabal b/hopfli.cabal
--- a/hopfli.cabal
+++ b/hopfli.cabal
@@ -1,53 +1,55 @@
 name:                hopfli
-version:             0.2.1.0
-synopsis:            zlib compatible compression using Zopfli Compression Algorithm
-homepage:            https://github.com/ananthakumaran/hopfli
+version:             0.2.1.1
 license:             Apache-2.0
 license-file:        LICENSE
-author:              Anantha Kumaran
-maintainer:          ananthakumaran@gmail.com
+author:              Anantha Kumaran <ananthakumaran@gmail.com>
+maintainer:          Cristian Adrián Ontivero <cristianontivero@gmail.com>
+homepage:            https://github.com/ananthakumaran/hopfli
+bug-reports:         https://github.com/ananthakumaran/hopfli/issues
+synopsis:            Bidings to Google's Zopfli compression library
 category:            Codec
 build-type:          Simple
 cabal-version:       >=1.10
-description:         Hopfli provides a pure interface to compress data using Zopfli algorithm.
+extra-source-files:  README.md
+description:
+    Hopfli provides a pure interface to compress data using the Zopfli library
+    algorithm.
 
 source-repository head
   type: git
   location: https://github.com/ananthakumaran/hopfli
 
 library
-  exposed-modules: Codec.Compression.Hopfli
-  other-modules: Codec.Compression.Hopfli.Raw
-  build-depends:       base >=4 && <5,
-                       bytestring >= 0.9 && < 0.12,
-                       zlib >= 0.5.4
-
-  hs-source-dirs:  src
-  ghc-options: -Wall
-  default-language:    Haskell2010
-  include-dirs: src/cbits
-  c-sources: src/cbits/blocksplitter.c src/cbits/cache.c src/cbits/deflate.c
-             src/cbits/gzip_container.c src/cbits/hash.c src/cbits/katajainen.c
-             src/cbits/lz77.c src/cbits/squeeze.c src/cbits/tree.c src/cbits/util.c
-             src/cbits/zlib_container.c src/cbits/zopfli_lib.c
-
-  includes: blocksplitter.h, cache.h, deflate.h, gzip_container.h, hash.h,
-            katajainen.h, lz77.h, squeeze.h, tree.h, util.h, zlib_container.h,
-            zopfli.h
-  install-includes: blocksplitter.h, cache.h, deflate.h, gzip_container.h,
-                    hash.h, katajainen.h, lz77.h, squeeze.h, tree.h, util.h,
-                    zlib_container.h, zopfli.h
+  hs-source-dirs:    src
+  default-language:  Haskell2010
+  exposed-modules:   Codec.Compression.Hopfli
+  other-modules:     Codec.Compression.Hopfli.Raw
+  ghc-options:       -Wall -fwarn-tabs -fwarn-unused-do-bind
+  build-depends:     base       >=4     && <5
+                   , bytestring >=0.9   && <0.12
+                   , zlib       >=0.5.4 && <0.7
+  include-dirs:      src/cbits
+  c-sources:         src/cbits/blocksplitter.c src/cbits/cache.c src/cbits/deflate.c
+                     src/cbits/gzip_container.c src/cbits/hash.c src/cbits/katajainen.c
+                     src/cbits/lz77.c src/cbits/squeeze.c src/cbits/tree.c src/cbits/util.c
+                     src/cbits/zlib_container.c src/cbits/zopfli_lib.c
+  includes:          blocksplitter.h, cache.h, deflate.h, gzip_container.h, hash.h,
+                     katajainen.h, lz77.h, squeeze.h, tree.h, util.h, zlib_container.h,
+                     zopfli.h
+  install-includes:  blocksplitter.h, cache.h, deflate.h, gzip_container.h,
+                     hash.h, katajainen.h, lz77.h, squeeze.h, tree.h, util.h,
+                     zlib_container.h, zopfli.h
 
 test-suite test
-  hs-source-dirs: test
-  main-is: Spec.hs
-  type: exitcode-stdio-1.0
-  ghc-options: -Wall
-  build-depends:   base >=4 && <5,
-                   bytestring >= 0.9 && < 0.12,
-                   hspec == 1.7.2.1,
-                   zlib >= 0.5.4,
-                   QuickCheck == 2.6,
-                   hopfli == 0.2.1.0
-
-  default-language:    Haskell2010
+  hs-source-dirs:   test
+  default-language: Haskell2010
+  main-is:          Spec.hs
+  type:             exitcode-stdio-1.0
+  ghc-options:      -Wall -fwarn-tabs -fwarn-unused-do-bind
+  other-modules:    HopfliSpec
+  build-depends:    base       >=4       && <5
+                  , bytestring >=0.9     && <0.12
+                  , hspec      >=1.7.2.1 && <2.5
+                  , zlib       >=0.5.4   && <0.7
+                  , QuickCheck >=2.6     && <2.10
+                  , hopfli
diff --git a/src/Codec/Compression/Hopfli/Raw.hsc b/src/Codec/Compression/Hopfli/Raw.hsc
--- a/src/Codec/Compression/Hopfli/Raw.hsc
+++ b/src/Codec/Compression/Hopfli/Raw.hsc
@@ -14,7 +14,7 @@
 import           Data.ByteString.Internal   (fromForeignPtr, toForeignPtr)
 import qualified Data.ByteString.Lazy       as BL
 import           Data.ByteString.Lazy.Char8 ()
-import           Foreign                    hiding (unsafePerformIO)
+import           Foreign
 import           Foreign.C.Types
 import           Prelude                    hiding (length)
 import           System.IO.Unsafe           (unsafePerformIO)
@@ -63,8 +63,8 @@
 
 compress :: Options -> Format -> B.ByteString -> B.ByteString
 -- zopfli doesn't handle zero length data
-compress _ GZIP "" = B.concat . BL.toChunks $ G.compress ""
-compress _ ZLIB "" = B.concat . BL.toChunks $ Z.compress ""
+compress _ GZIP ""    = B.concat . BL.toChunks $ G.compress ""
+compress _ ZLIB ""    = B.concat . BL.toChunks $ Z.compress ""
 compress _ DEFLATE "" = B.concat . BL.toChunks $ ZR.compress ""
 
 compress options format input = unsafePerformIO $ do
diff --git a/test/HopfliSpec.hs b/test/HopfliSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/HopfliSpec.hs
@@ -0,0 +1,39 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
+module HopfliSpec (spec) where
+
+import           Test.Hspec
+import           Test.QuickCheck
+
+import qualified Codec.Compression.GZip     as GZip
+import           Codec.Compression.Hopfli
+import qualified Codec.Compression.Zlib     as Zlib
+import qualified Codec.Compression.Zlib.Raw as ZRaw
+import qualified Data.ByteString            as B
+import qualified Data.ByteString.Lazy       as BL
+
+toStrict :: BL.ByteString -> B.ByteString
+toStrict = B.concat . BL.toChunks
+
+toLazy :: B.ByteString -> BL.ByteString
+toLazy str = BL.fromChunks  [str]
+
+instance Arbitrary B.ByteString where
+  arbitrary = B.pack <$> arbitrary
+
+instance CoArbitrary B.ByteString where
+  coarbitrary = coarbitrary . B.unpack
+
+makeStrict :: (BL.ByteString -> BL.ByteString) -> B.ByteString -> B.ByteString
+makeStrict decompressor = toStrict . decompressor . toLazy
+
+spec :: Spec
+spec =
+  describe "compress" $ do
+    it "should compress in zlib compatible format" $ property $
+      \payload -> (makeStrict Zlib.decompress . compress $ payload) == payload
+    it "should compress in gzip compatible format" $ property $
+      \payload -> (makeStrict GZip.decompress . compressWith defaultCompressOptions GZIP $ payload) == payload
+    it "should compress in deflate compatible format" $ property $
+      \payload -> (makeStrict ZRaw.decompress . compressWith defaultCompressOptions DEFLATE $ payload) == payload
