diff --git a/elm-export.cabal b/elm-export.cabal
--- a/elm-export.cabal
+++ b/elm-export.cabal
@@ -1,5 +1,5 @@
 name: elm-export
-version: 0.4.1.0
+version: 0.4.1.1
 cabal-version: >=1.10
 build-type: Simple
 license: OtherLicense
@@ -13,6 +13,8 @@
     Generate Elm source code automatically from Haskell types. Using GHC.Generics, we can automatically derive Elm type declarations, and Aeson-compatible JSON decoders & encoders.
 category: Web
 author: Kris Jenkins
+extra-source-files:
+    test/*.elm
 
 source-repository head
     type: git
@@ -48,7 +50,7 @@
         base >=4.8.2.0 && <4.9,
         bytestring >=0.10.6.0 && <0.11,
         containers >=0.5.6.2 && <0.6,
-        elm-export >=0.4.1.0 && <0.5,
+        elm-export >=0.4.1.1 && <0.5,
         hspec >=2.2.2 && <2.3,
         hspec-core >=2.2.2 && <2.3,
         quickcheck-instances >=0.3.12 && <0.4,
diff --git a/test/CommentDecoder.elm b/test/CommentDecoder.elm
new file mode 100644
--- /dev/null
+++ b/test/CommentDecoder.elm
@@ -0,0 +1,18 @@
+module CommentDecoder exposing (..)
+
+import CommentType exposing (..)
+import Date
+import Dict
+import Json.Decode exposing (..)
+import Json.Decode.Pipeline exposing (..)
+
+
+decodeComment : Decoder Comment
+decodeComment =
+    decode Comment
+        |> required "postId" int
+        |> required "text" string
+        |> required "mainCategories" (tuple2 (,) string string)
+        |> required "published" bool
+        |> required "created" (customDecoder string Date.fromString)
+        |> required "tags" (map Dict.fromList (list (tuple2 (,) string int)))
diff --git a/test/CommentDecoderWithOptions.elm b/test/CommentDecoderWithOptions.elm
new file mode 100644
--- /dev/null
+++ b/test/CommentDecoderWithOptions.elm
@@ -0,0 +1,18 @@
+module CommentDecoderWithOptions exposing (..)
+
+import CommentType exposing (..)
+import Date
+import Dict
+import Json.Decode exposing (..)
+import Json.Decode.Pipeline exposing (..)
+
+
+decodeComment : Decoder Comment
+decodeComment =
+    decode Comment
+        |> required "commentPostId" int
+        |> required "commentText" string
+        |> required "commentMainCategories" (tuple2 (,) string string)
+        |> required "commentPublished" bool
+        |> required "commentCreated" (customDecoder string Date.fromString)
+        |> required "commentTags" (map Dict.fromList (list (tuple2 (,) string int)))
diff --git a/test/CommentEncoder.elm b/test/CommentEncoder.elm
new file mode 100644
--- /dev/null
+++ b/test/CommentEncoder.elm
@@ -0,0 +1,18 @@
+module CommentEncoder exposing (..)
+
+import CommentType exposing (..)
+import Exts.Date exposing (..)
+import Exts.Json.Encode exposing (..)
+import Json.Encode exposing (..)
+
+
+encodeComment : Comment -> Value
+encodeComment x =
+    object
+        [ ( "postId", int x.postId )
+        , ( "text", string x.text )
+        , ( "mainCategories", tuple2 string string x.mainCategories )
+        , ( "published", bool x.published )
+        , ( "created", (string << toISOString) x.created )
+        , ( "tags", dict string int x.tags )
+        ]
diff --git a/test/CommentEncoderWithOptions.elm b/test/CommentEncoderWithOptions.elm
new file mode 100644
--- /dev/null
+++ b/test/CommentEncoderWithOptions.elm
@@ -0,0 +1,18 @@
+module CommentEncoderWithOptions exposing (..)
+
+import CommentType exposing (..)
+import Exts.Date exposing (..)
+import Exts.Json.Encode exposing (..)
+import Json.Encode exposing (..)
+
+
+encodeComment : Comment -> Value
+encodeComment x =
+    object
+        [ ( "commentPostId", int x.postId )
+        , ( "commentText", string x.text )
+        , ( "commentMainCategories", tuple2 string string x.mainCategories )
+        , ( "commentPublished", bool x.published )
+        , ( "commentCreated", (string << toISOString) x.created )
+        , ( "commentTags", dict string int x.tags )
+        ]
diff --git a/test/CommentType.elm b/test/CommentType.elm
new file mode 100644
--- /dev/null
+++ b/test/CommentType.elm
@@ -0,0 +1,14 @@
+module CommentType exposing (..)
+
+import Date exposing (Date)
+import Dict exposing (Dict)
+
+
+type alias Comment =
+    { postId : Int
+    , text : String
+    , mainCategories : ( String, String )
+    , published : Bool
+    , created : Date
+    , tags : Dict String Int
+    }
diff --git a/test/CommentTypeWithOptions.elm b/test/CommentTypeWithOptions.elm
new file mode 100644
--- /dev/null
+++ b/test/CommentTypeWithOptions.elm
@@ -0,0 +1,14 @@
+module CommentTypeWithOptions exposing (..)
+
+import Date exposing (Date)
+import Dict exposing (Dict)
+
+
+type alias Comment =
+    { commentPostId : Int
+    , commentText : String
+    , commentMainCategories : ( String, String )
+    , commentPublished : Bool
+    , commentCreated : Date
+    , commentTags : Dict String Int
+    }
diff --git a/test/PositionType.elm b/test/PositionType.elm
new file mode 100644
--- /dev/null
+++ b/test/PositionType.elm
@@ -0,0 +1,7 @@
+module PositionType exposing (..)
+
+
+type Position
+    = Beginning
+    | Middle
+    | End
diff --git a/test/PostDecoder.elm b/test/PostDecoder.elm
new file mode 100644
--- /dev/null
+++ b/test/PostDecoder.elm
@@ -0,0 +1,17 @@
+module PostDecoder exposing (..)
+
+import CommentDecoder exposing (..)
+import Json.Decode exposing (..)
+import Json.Decode.Pipeline exposing (..)
+import PostType exposing (..)
+
+
+decodePost : Decoder Post
+decodePost =
+    decode Post
+        |> required "id" int
+        |> required "name" string
+        |> required "age" (maybe float)
+        |> required "comments" (list decodeComment)
+        |> required "promoted" (maybe decodeComment)
+        |> required "author" (maybe string)
diff --git a/test/PostDecoderWithOptions.elm b/test/PostDecoderWithOptions.elm
new file mode 100644
--- /dev/null
+++ b/test/PostDecoderWithOptions.elm
@@ -0,0 +1,17 @@
+module PostDecoderWithOptions exposing (..)
+
+import CommentDecoder exposing (..)
+import Json.Decode exposing (..)
+import Json.Decode.Pipeline exposing (..)
+import PostType exposing (..)
+
+
+decodePost : Decoder Post
+decodePost =
+    decode Post
+        |> required "postId" int
+        |> required "postName" string
+        |> required "postAge" (maybe float)
+        |> required "postComments" (list decodeComment)
+        |> required "postPromoted" (maybe decodeComment)
+        |> required "postAuthor" (maybe string)
diff --git a/test/PostEncoder.elm b/test/PostEncoder.elm
new file mode 100644
--- /dev/null
+++ b/test/PostEncoder.elm
@@ -0,0 +1,17 @@
+module PostEncoder exposing (..)
+
+import CommentEncoder exposing (..)
+import Json.Encode exposing (..)
+import PostType exposing (..)
+
+
+encodePost : Post -> Value
+encodePost x =
+    object
+        [ ( "id", int x.id )
+        , ( "name", string x.name )
+        , ( "age", (Maybe.withDefault null << Maybe.map float) x.age )
+        , ( "comments", (list << List.map encodeComment) x.comments )
+        , ( "promoted", (Maybe.withDefault null << Maybe.map encodeComment) x.promoted )
+        , ( "author", (Maybe.withDefault null << Maybe.map string) x.author )
+        ]
diff --git a/test/PostEncoderWithOptions.elm b/test/PostEncoderWithOptions.elm
new file mode 100644
--- /dev/null
+++ b/test/PostEncoderWithOptions.elm
@@ -0,0 +1,17 @@
+module PostEncoderWithOptions exposing (..)
+
+import CommentEncoder exposing (..)
+import Json.Encode exposing (..)
+import PostType exposing (..)
+
+
+encodePost : Post -> Value
+encodePost x =
+    object
+        [ ( "postId", int x.id )
+        , ( "postName", string x.name )
+        , ( "postAge", (Maybe.withDefault null << Maybe.map float) x.age )
+        , ( "postComments", (list << List.map encodeComment) x.comments )
+        , ( "postPromoted", (Maybe.withDefault null << Maybe.map encodeComment) x.promoted )
+        , ( "postAuthor", (Maybe.withDefault null << Maybe.map string) x.author )
+        ]
diff --git a/test/PostType.elm b/test/PostType.elm
new file mode 100644
--- /dev/null
+++ b/test/PostType.elm
@@ -0,0 +1,13 @@
+module PostType exposing (..)
+
+import CommentType exposing (..)
+
+
+type alias Post =
+    { id : Int
+    , name : String
+    , age : Maybe Float
+    , comments : List Comment
+    , promoted : Maybe Comment
+    , author : Maybe String
+    }
diff --git a/test/PostTypeWithOptions.elm b/test/PostTypeWithOptions.elm
new file mode 100644
--- /dev/null
+++ b/test/PostTypeWithOptions.elm
@@ -0,0 +1,13 @@
+module PostTypeWithOptions exposing (..)
+
+import CommentType exposing (..)
+
+
+type alias Post =
+    { postId : Int
+    , postName : String
+    , postAge : Maybe Float
+    , postComments : List Comment
+    , postPromoted : Maybe Comment
+    , postAuthor : Maybe String
+    }
