Subtle fix to write error handling; clarify logic.
Subtle fix to write error handling; clarify logic.

leetreveil/tulip,overcastcloud/trollius,leetreveil/tulip,leetreveil/tulip,overcastcloud/trollius,overcastcloud/trollius