Update for 0-byte file support, including test case.

Please review the following code fix for 0-byte files. Test case has been included.