diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/haskell/readme.md b/haskell/readme.md
--- a/haskell/readme.md
+++ b/haskell/readme.md
@@ -6,8 +6,38 @@
 $ ./test/Example
 ```
 
+See the [API documentation](https://hackage.haskell.org/package/isocline-1.0.0/docs/System-Console-Isocline.html) on hackage.
+
+## Using with Stack
+
+You can build with isocline by adding 
+```
+extra-deps:
+  - isocline-1.0.0  
+```
+to your `stack.yaml` file, and 
+```
+dependencies:
+  - isocline
+```
+to your `package.yaml` file (and also run `stack update`).
+
+## Using with Cabal
+
+To use it with Cabal, add
+```
+build-depends:
+  isocline
+```
+to your `project.cabal` file (and perhaps run `cabal update`).
+
+
+# Building Isocline from Source
+
 ## Building with Stack
 
+From the isocline directory, run:
+
 ```
 $ stack build
 $ stack exec example
@@ -15,12 +45,14 @@
 
 ## Building with Cabal
 
+From the isocline directory, run:
+
 ```
 $ cabal build
 $ cabal run example
 ```
 
-You can install the `isocline` package locally as:
+You can install the locally build `isocline` package as:
 ```
 $ cabal install
 ```
diff --git a/include/isocline.h b/include/isocline.h
--- a/include/isocline.h
+++ b/include/isocline.h
@@ -45,7 +45,7 @@
 /// \{
 
 /// Isocline version: 102 = 1.0.2.
-#define IC_VERSION   (100)    /// 1.0.0
+#define IC_VERSION   (101)    /// 1.0.0
 
 
 /// Read input from the user using rich editing abilities.
diff --git a/isocline.cabal b/isocline.cabal
--- a/isocline.cabal
+++ b/isocline.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           isocline
-version:        1.0.0
+version:        1.0.1
 synopsis:       A portable alternative to GNU Readline
 description:    ![logo](https://raw.githubusercontent.com/daanx/isocline/main/doc/isocline-inline.svg) A Haskell wrapper around the [Isocline C library](https://github.com/daanx/isocline#readme) which can provide an alternative to GNU Readline. (The Isocline library is included whole and there are no runtime dependencies).
                 Please see the [readme](https://github.com/daanx/isocline/haskell#readme) on GitHub for more information.
diff --git a/src/term.c b/src/term.c
--- a/src/term.c
+++ b/src/term.c
@@ -483,7 +483,6 @@
     while ((next = str_next_ofs(s, len, pos+ascii, NULL)) > 0 && 
             (uint8_t)s[pos + ascii] > '\x1B' && (uint8_t)s[pos + ascii] <= 0x7F ) 
     {
-      if (s[pos+ascii] == '\n') { newline = true; }
       ascii += next;      
     }
     if (ascii > 0) {
@@ -505,6 +504,7 @@
       // ignore control characters except \a, \b, \t, \n, \r, and form-feed and vertical tab.
     }
     else {
+      if (c == '\n') { newline = true; }
       sbuf_append_n(term->buf, s+pos, next);
     }
     pos += next;
diff --git a/src/tty.c b/src/tty.c
--- a/src/tty.c
+++ b/src/tty.c
@@ -18,6 +18,9 @@
 #define isatty(fd)     _isatty(fd)
 #define read(fd,s,n)   _read(fd,s,n)
 #define STDIN_FILENO   0
+#if (_WIN32_WINNT < 0x0600)
+WINBASEAPI ULONGLONG WINAPI GetTickCount64(VOID);
+#endif
 #else
 #include <signal.h>
 #include <errno.h>
