diff --git a/Data/JsonStream/CLexType.hs b/Data/JsonStream/CLexType.hs
new file mode 100644
--- /dev/null
+++ b/Data/JsonStream/CLexType.hs
@@ -0,0 +1,43 @@
+{-# LINE 1 "CLexType.hs" #-}
+{-# LINE 1 "CLexType.hsc" #-}
+{-# LINE 2 "CLexType.hs" #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LINE 2 "CLexType.hsc" #-}
+module Data.JsonStream.CLexType where
+
+import Foreign.C.Types
+import Foreign
+
+newtype LexResultType = LexResultType CInt deriving (Show, Eq, Storable)
+
+
+{-# LINE 10 "CLexType.hsc" #-}
+
+resNumber  :: LexResultType
+resNumber  = LexResultType 0
+resString  :: LexResultType
+resString  = LexResultType 1
+resTrue  :: LexResultType
+resTrue  = LexResultType 2
+resFalse  :: LexResultType
+resFalse  = LexResultType 3
+resNull  :: LexResultType
+resNull  = LexResultType 4
+resOpenBrace  :: LexResultType
+resOpenBrace  = LexResultType 5
+resCloseBrace  :: LexResultType
+resCloseBrace  = LexResultType 6
+resOpenBracket  :: LexResultType
+resOpenBracket  = LexResultType 7
+resCloseBracket  :: LexResultType
+resCloseBracket  = LexResultType 8
+resStringPartial  :: LexResultType
+resStringPartial  = LexResultType 9
+resStringUni  :: LexResultType
+resStringUni  = LexResultType 11
+resNumberPartial  :: LexResultType
+resNumberPartial  = LexResultType 10
+resNumberSmall  :: LexResultType
+resNumberSmall  = LexResultType 12
+
+{-# LINE 28 "CLexType.hsc" #-}
diff --git a/Data/JsonStream/Parser.hs b/Data/JsonStream/Parser.hs
--- a/Data/JsonStream/Parser.hs
+++ b/Data/JsonStream/Parser.hs
@@ -237,11 +237,11 @@
     (TokFailed) -> Failed "Array - token failed"
   where
     nextitem _ _ (ArrayEnd ctx) ntok = Done ctx ntok
-    nextitem i tok _ _ = arrcontent i (callParse (valparse i) tok)
+    nextitem !i tok _ _ = arrcontent i (callParse (valparse i) tok)
 
-    arrcontent i (Done _ ntp) = moreData (nextitem (i+1)) ntp
-    arrcontent i (MoreData (Parser np, ntp)) = MoreData (Parser (arrcontent i . np), ntp)
-    arrcontent i (Yield v np) = Yield v (arrcontent i np)
+    arrcontent !i (Done _ ntp) = moreData (nextitem (i+1)) ntp
+    arrcontent !i (MoreData (Parser np, ntp)) = MoreData (Parser (arrcontent i . np), ntp)
+    arrcontent !i (Yield v np) = Yield v (arrcontent i np)
     arrcontent _ (Failed err) = Failed err
 
 -- | Match all items of an array.
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,6 @@
+# 0.4.1.1
+Fixed memory leak in arrayOf
+
 # 0.4.1.0
 Added aeson-compatibile encode/decode functions.
 
diff --git a/json-stream.cabal b/json-stream.cabal
--- a/json-stream.cabal
+++ b/json-stream.cabal
@@ -1,5 +1,5 @@
 name:                json-stream
-version:             0.4.1.0
+version:             0.4.1.1
 synopsis:            Incremental applicative JSON parser
 description:         Easy to use JSON parser fully supporting incremental parsing.
                      Parsing grammar in applicative form.
