Don't ignore the potential error on w.Write

Fixes #83