Flush on close, do not attempt to read blocks that of length zero, and add additional testing to catch these cases.