Clean up (and hopefully not muck up) much poor stream handling.