diff --git a/src/Text/XmlHtml/Cursor.hs b/src/Text/XmlHtml/Cursor.hs
--- a/src/Text/XmlHtml/Cursor.hs
+++ b/src/Text/XmlHtml/Cursor.hs
@@ -146,7 +146,7 @@
 getChild i (Cursor n ls rs ps) =
     case n of
       Element t a cs -> let (lls, rest) = splitAt i cs in
-          if i >= length cs
+          if i >= length cs || i < 0
             then Nothing
             else Just $ Cursor (head rest)
                                (reverse lls)
diff --git a/test/suite/Text/XmlHtml/CursorTests.hs b/test/suite/Text/XmlHtml/CursorTests.hs
--- a/test/suite/Text/XmlHtml/CursorTests.hs
+++ b/test/suite/Text/XmlHtml/CursorTests.hs
@@ -118,6 +118,7 @@
     assertBool "parent of root" $ isNothing (parent r)
 
     assertBool "getChild bounds" $ isNothing (getChild 3 r)
+    assertBool "getChild negative bounds" $ isNothing (getChild (-1) r)
     assertBool "firstChild"      $
         getAttribute "name" (current e1) == Just "alice"
     assertBool "childAt 1 "      $
diff --git a/xmlhtml.cabal b/xmlhtml.cabal
--- a/xmlhtml.cabal
+++ b/xmlhtml.cabal
@@ -1,5 +1,5 @@
 Name:                xmlhtml
-Version:             0.2.0.3
+Version:             0.2.0.4
 Synopsis:            XML parser and renderer with HTML 5 quirks mode
 Description:         Contains renderers and parsers for both XML and HTML 5
                      document fragments, which share data structures so that
@@ -821,7 +821,7 @@
 
   Build-depends:       base                 >= 4     && < 5,
                        blaze-builder        >= 0.2   && < 0.4,
-                       blaze-html           >= 0.5   && < 0.6,
+                       blaze-html           >= 0.5   && < 0.7,
                        blaze-markup         >= 0.5   && < 0.6,
                        bytestring           >= 0.9   && < 0.11,
                        containers           >= 0.3   && < 0.6,
