diff --git a/cbits/fork_exec_with_pty.c b/cbits/fork_exec_with_pty.c
--- a/cbits/fork_exec_with_pty.c
+++ b/cbits/fork_exec_with_pty.c
@@ -41,23 +41,14 @@
     int pty;
     int packet_mode = 1;
     struct winsize ws;
-    struct termios tio;
 
     /* Set the terminal size and settings. */
     memset(&ws, 0, sizeof ws);
     ws.ws_col = sx;
     ws.ws_row = sy;
 
-    memset(&tio, 0, sizeof tio);
-    tio.c_iflag = TTYDEF_IFLAG;
-    tio.c_oflag = TTYDEF_OFLAG;
-    tio.c_lflag = TTYDEF_LFLAG;
-    tio.c_cflag = TTYDEF_CFLAG;
-    memcpy(&tio.c_cc, ttydefchars, sizeof tio.c_cc);
-    cfsetspeed(&tio, TTYDEF_SPEED);
-
     /* Fork and exec, returning the master pty. */
-    *child_pid = forkpty(&pty, NULL, &tio, &ws);
+    *child_pid = forkpty(&pty, NULL, NULL, &ws);
     switch (*child_pid) {
     case -1:
         return -1;
diff --git a/posix-pty.cabal b/posix-pty.cabal
--- a/posix-pty.cabal
+++ b/posix-pty.cabal
@@ -1,5 +1,5 @@
 Name:                posix-pty
-Version:             0.2.1
+Version:             0.2.1.1
 
 Homepage:            https://bitbucket.org/merijnv/posix-pty
 Bug-Reports:         https://github.com/merijn/posix-pty/issues
@@ -28,7 +28,7 @@
 Library
   Default-Language:     Haskell2010
   GHC-Options:          -Wall
-  GHC-Prof-Options:     -auto-all -caf-all -rtsopts
+  GHC-Prof-Options:     -auto-all -caf-all
   Exposed-Modules:      System.Posix.Pty
   Other-Modules:        
 
@@ -44,6 +44,17 @@
 
   if os(linux) || os(freebsd)
     Extra-Libraries: util
+
+Test-Suite stty
+  Type: exitcode-stdio-1.0
+  Default-Language:     Haskell2010
+  Main-Is:              stty.hs
+  Ghc-Options:          -w -threaded -rtsopts -with-rtsopts=-N
+  Hs-Source-Dirs:       tests
+  Build-Depends:        base
+               ,        bytestring
+               ,        posix-pty
+               ,        process
 
 Source-Repository head
   Type:     git
diff --git a/tests/stty.hs b/tests/stty.hs
new file mode 100644
--- /dev/null
+++ b/tests/stty.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE LambdaCase #-}
+module Main where
+
+import Control.Monad (forever, void)
+import Data.ByteString as BS (putStr)
+import System.Process (waitForProcess)
+import System.Posix.Pty
+
+main :: IO ()
+main = do
+    (pty, hnd) <- spawnWithPty Nothing True "stty" ["-a"] (10, 10)
+    forever $ tryReadPty pty >>= \case
+        Left e -> print e
+        Right s -> BS.putStr s >> putStrLn ""
+    void $ waitForProcess hnd
