Added 'broken pipe' exception handling.