Don't throw error writing zero-length objects. Fixes #11.

Also replaced deprecated methods in test script.

Feel free to take another approach and close this one.