Don't ignore the result of write ()

Fixes #3