Handling stream error better.