diff --git a/Data/IP/Addr.hs b/Data/IP/Addr.hs
--- a/Data/IP/Addr.hs
+++ b/Data/IP/Addr.hs
@@ -512,8 +512,8 @@
     _ <- char '.'
     a3 <- octet
     let as = [a0, a1, a2, a3]
-    skipSpaces
-    when checkTermination termination
+    when checkTermination $
+      skipSpaces >> termination
     return as
 
 skipSpaces :: Parser ()
diff --git a/iproute.cabal b/iproute.cabal
--- a/iproute.cabal
+++ b/iproute.cabal
@@ -1,6 +1,6 @@
 cabal-version: >=1.10
 name:          iproute
-version:       1.7.13
+version:       1.7.14
 license:       BSD3
 license-file:  LICENSE
 maintainer:    Kazu Yamamoto <kazu@iij.ad.jp>
diff --git a/test/IPSpec.hs b/test/IPSpec.hs
--- a/test/IPSpec.hs
+++ b/test/IPSpec.hs
@@ -24,8 +24,11 @@
 
 instance Arbitrary InvalidIPv4Str where
     arbitrary = 
-        frequency [(9, arbitraryIIPv4Str arbitrary 32)
+        frequency [(8, arbitraryIIPv4Str arbitrary 32)
+                   -- an IPv4 address should not end with a trailing `.`
                   ,(1, Iv4 . (++ ".") . show <$> genIPv4)
+                   -- an IPv4 address with mask should not include a white space
+                  ,(1, (\ip (NonNegative len) -> Iv4 (show ip ++ " /" ++ show (len :: Integer))) <$> genIPv4 <*> arbitrary)
                   ]
       where
         genIPv4 :: Gen IPv4
