diff --git a/Data/ByteString.hs b/Data/ByteString.hs
--- a/Data/ByteString.hs
+++ b/Data/ByteString.hs
@@ -259,6 +259,8 @@
 
 #if MIN_VERSION_base(4,3,0)
 import System.IO                (hGetBufSome)
+#else
+import System.IO                (hWaitForInput, hIsEOF)
 #endif
 
 #if __GLASGOW_HASKELL__ >= 611
@@ -286,10 +288,17 @@
 
 -- An alternative to Control.Exception (assert) for nhc98
 #ifdef __NHC__
+
+import System.IO (Handle)
+
 #define assert  assertS "__FILE__ : __LINE__"
 assertS :: String -> Bool -> a -> a
 assertS _ True  = id
 assertS s False = error ("assertion failed at "++s)
+
+-- An alternative to hWaitForInput
+hWaitForInput :: Handle -> Int -> IO ()
+hWaitForInput _ _ = return ()
 #endif
 
 -- -----------------------------------------------------------------------------
@@ -1955,12 +1964,12 @@
 #else
     | i >  0    = let
                    loop = do
-                     s <- hGetNonBlocking h i
+                     s <- hGetNonBlocking hh i
                      if not (null s)
                         then return s
-                        else eof <- hIsEOF h
-                             if eof then return s
-                                    else hWaitForInput h (-1) >> loop
+                        else do eof <- hIsEOF hh
+                                if eof then return s
+                                       else hWaitForInput hh (-1) >> loop
                                          -- for this to work correctly, the
                                          -- Handle should be in binary mode
                                          -- (see GHC ticket #3808)
diff --git a/Data/ByteString/Char8.hs b/Data/ByteString/Char8.hs
--- a/Data/ByteString/Char8.hs
+++ b/Data/ByteString/Char8.hs
@@ -270,7 +270,7 @@
 #endif
 
 #if __GLASGOW_HASKELL__ >= 608
-import Data.String
+import Data.String              (IsString(..))
 #endif
 
 #define STRICT1(f) f a | a `seq` False = undefined
diff --git a/Data/ByteString/Lazy/Char8.hs b/Data/ByteString/Lazy/Char8.hs
--- a/Data/ByteString/Lazy/Char8.hs
+++ b/Data/ByteString/Lazy/Char8.hs
@@ -211,7 +211,7 @@
 #endif
 
 #if __GLASGOW_HASKELL__ >= 608
-import Data.String
+import Data.String          (IsString(..))
 #endif
 
 #define STRICT1(f) f a | a `seq` False = undefined
diff --git a/bytestring.cabal b/bytestring.cabal
--- a/bytestring.cabal
+++ b/bytestring.cabal
@@ -1,5 +1,5 @@
 Name:                bytestring
-Version:             0.9.1.8
+Version:             0.9.1.9
 Synopsis:            Fast, packed, strict and lazy byte arrays with a list interface
 Description:
     A time and space-efficient implementation of byte vectors using
