Fixed file download ending prematurely on slow connections.