diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE OverloadedStrings  #-}
+{-# LANGUAGE RecordWildCards    #-}
 
 import           Control.Monad          (replicateM_)
 import           Data.Monoid            ((<>))
@@ -30,7 +31,7 @@
     , prefix = ""
       &= typ " <Prefix>"
       &= help "Set a prefix for random addresses generation"
-    } &= summary "ip6addr version 0.5.1.0 (C) Michel Boucey 2015-2016"
+    } &= summary "ip6addr version 0.5.1.2 (C) Michel Boucey 2015-2016"
       &= program "ip6addr"
       &= helpArg [name "h"]
       &= details [ "Examples:"
@@ -43,18 +44,16 @@
 
 main :: IO ()
 main = do
-    a <- cmdArgs ip6addrInput
-    if output a == "random"
-        then replicateM_ (quantity a) (putRandAddr (prefix a)) >> exitSuccess
-        else do
-            let m = address a
-            case output a of
-                "canonical" -> out maybeIPv6Addr m fromIPv6Addr
-                "pure"      -> out maybePureIPv6Addr m fromIPv6Addr
-                "full"      -> out maybeFullIPv6Addr m fromIPv6Addr
-                "arpa"      -> out maybeIP6ARPA m id
-                "unc"       -> out maybeUNC m id
-                _           -> TIO.hPutStrLn stderr "See help" >> exitFailure
+    Input {..} <- cmdArgs ip6addrInput
+    if output == "random"
+        then replicateM_ quantity (putRandAddr prefix) >> exitSuccess
+        else case output of
+                 "canonical" -> out maybeIPv6Addr address fromIPv6Addr
+                 "pure"      -> out maybePureIPv6Addr address fromIPv6Addr
+                 "full"      -> out maybeFullIPv6Addr address fromIPv6Addr
+                 "arpa"      -> out maybeIP6ARPA address id
+                 "unc"       -> out maybeUNC address id
+                 _           -> TIO.hPutStrLn stderr "See help" >> exitFailure
   where
     putRandAddr p = do
         r <- randIPv6AddrWithPrefix $
diff --git a/ip6addr.cabal b/ip6addr.cabal
--- a/ip6addr.cabal
+++ b/ip6addr.cabal
@@ -1,5 +1,5 @@
 name:                ip6addr
-version:             0.5.1.0
+version:             0.5.1.2
 synopsis:            Commandline tool to generate IPv6 address text representations
 description:         Commandline tool to generate IPv6 address text representations
 license:             BSD3
@@ -7,7 +7,7 @@
 author:              Michel Boucey
 maintainer:          michel.boucey@gmail.com
 homepage:            https://github.com/MichelBoucey/ip6addr
-Copyright:           Copyright (C) 2011-2016 - Michel Boucey
+Copyright:           Copyright (c) 2011-2016 - Michel Boucey
 Category:            Network,Console
 build-type:          Simple
 cabal-version:       >=1.10
@@ -17,9 +17,12 @@
   Location: https://github.com/MichelBoucey/ip6addr.git
 
 executable ip6addr
-  GHC-Options:         -Wall
   main-is:             Main.hs
-  other-extensions:    DeriveDataTypeable, OverloadedStrings
-  build-depends:       base >=4.7 && <4.9, cmdargs,IPv6Addr >= 0.6, text >= 1.2
+  other-extensions:    DeriveDataTypeable
+                     , OverloadedStrings
+  build-depends:       base >=4.7 && <5
+                     , cmdargs
+                     , IPv6Addr >= 0.6
+                     , text >= 1.2
   default-language:    Haskell2010
-
+  GHC-Options:         -Wall
