Added a potential fix and error logging for 'Broken pipe' errors.