Corrected end-of-file bound check to accomodate write length parameter, and added a test for it.
v1.0.1