diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+2019-12-23 Frank Dedden <dev@dedden.net>
+        * Version bump (3.1.1).
+        * Fixed bug with constant structs and arrays.(#13).
+
 2019-11-22 Ivan Perez <ivan.perez@nianet.org>
         * Version bump (3.1).
         * Remove ExternFun (#6).
diff --git a/copilot-c99.cabal b/copilot-c99.cabal
--- a/copilot-c99.cabal
+++ b/copilot-c99.cabal
@@ -1,6 +1,6 @@
 cabal-version             : >= 1.10
 name                      : copilot-c99
-version                   : 3.1
+version                   : 3.1.1
 synopsis                  : A compiler for Copilot targeting C99.
 description               :
   This package is a back-end from Copilot to C.
diff --git a/src/Copilot/Compile/C99/CodeGen.hs b/src/Copilot/Compile/C99/CodeGen.hs
--- a/src/Copilot/Compile/C99/CodeGen.hs
+++ b/src/Copilot/Compile/C99/CodeGen.hs
@@ -43,7 +43,7 @@
   name     = streamname sid
   cty      = C.Array (transtype ty) (Just $ C.LitInt $ fromIntegral buffsize)
   buffsize = length xs
-  initvals = Just $ C.InitArray $ map (mkinit ty) xs
+  initvals = Just $ C.InitArray $ map (C.InitExpr . constty ty) xs
 
 -- | Make a C index variable and initialise it to 0.
 mkindexdecln :: Id -> C.Decln
@@ -51,13 +51,6 @@
   name    = indexname sid
   cty     = C.TypeSpec $ C.TypedefName "size_t"
   initval = Just $ C.InitExpr $ C.LitInt 0
-
--- | Make an initial declaration from a single value.
-mkinit :: Type a -> a -> C.Init
-mkinit (Array ty') xs = C.InitArray $ map (mkinit ty') (arrayelems xs)
-mkinit (Struct _)  x  = C.InitArray $ map fieldinit (toValues x) where
-  fieldinit (Value ty (Field val)) = mkinit ty val
-mkinit ty          x  = C.InitExpr  $ constty ty x
 
 -- | The step function updates all streams,a
 mkstep :: [Stream] -> [Trigger] -> [External] -> C.FunDef
diff --git a/src/Copilot/Compile/C99/Translate.hs b/src/Copilot/Compile/C99/Translate.hs
--- a/src/Copilot/Compile/C99/Translate.hs
+++ b/src/Copilot/Compile/C99/Translate.hs
@@ -122,6 +122,12 @@
   Word64 -> C.LitInt . fromIntegral
   Float  -> C.LitFloat
   Double -> C.LitDouble
+  Struct _ -> \v -> C.InitVal (transtypename ty) (map fieldinit (toValues v))
+    where
+      fieldinit (Value ty (Field val)) = C.InitExpr $ constty ty val
+  Array ty' -> \v -> C.InitVal (transtypename ty) (map valinit (arrayelems v))
+    where
+      valinit = C.InitExpr . constty ty'
 
 -- | Translate a Copilot type to a C99 type.
 transtype :: Type a -> C.Type
