Improving recovery after network errors