Index: tests/test_gio.py
===================================================================
--- tests/test_gio.py	(revision 944)
+++ tests/test_gio.py	(working copy)
@@ -483,7 +483,10 @@
         os.unlink("inputstream.txt")
 
     def testRead(self):
-        self.assertEquals(self.stream.read(), "testing")
+        self.stream = gio.MemoryInputStream()
+        some_data = open("test_gio.py", "rb").read()
+        self.stream.add_data(some_data)
+        self.assertEquals(self.stream.read(), some_data)
 
     def testReadAsync(self):
         def callback(stream, result):
Index: gio/ginputstream.override
===================================================================
--- gio/ginputstream.override	(revision 945)
+++ gio/ginputstream.override	(working copy)
@@ -117,14 +117,13 @@
                     return NULL;
                 }
             else if (chunksize == 0)
-                {
-                    PyErr_SetFromErrno(PyExc_IOError);
-                    Py_DECREF(v);
-                    return NULL;
-                }
+                /* 0 is returned at the EOF or if count = 0 so we can break */
+                break;
 
             bytesread += chunksize;
-            if (bytesread < buffersize)
+
+            /* if bytesread > buffersize we can break */
+            if (bytesread > buffersize)
                 break;
 
             if (count < 0)
