Patch for "Broken pipe exception"