After slumping as much as 1.7% after trading began, the S&P 500 wavered through the day before cutting its loss to 0.5% by the afternoon. Most stocks across the market were higher, including two out of three in the S&P 500.

The paring of losses came as optimism rose that Washington may be able to get past its partisanship to deliver more support for the economy. House Speaker Nancy Pelosi told airlines in the afternoon to stop furloughing workers because aid for them is imminent. She said a wider rescue package for the economy, one that investors have long been agitating for, could also perhaps be on the way.

The Dow Jones Industrial Average swung from a loss of 433 points to a gain of as much as 44 points. It was up 2 points, or less than 0.1%, at 27,819, as of 2:08 p.m. Eastern time. Smaller stocks were rallying more than the rest of the market, and the Russell 2000 index of small-cap stocks was up 0.3%.

Big technology stocks remained weak, though, and the Nasdaq composite was down 1.6%. It’s a sharp departure from much of the summer, when Big Tech stocks carried the market higher, though their remarkable ascent left critics calling them too expensive.

Earlier Friday morning, markets appeared set for much sharper declines. Stock futures and Treasury yields tumbled after Trump tweeted overnight that he and First Lady Melania Trump had tested positive for COVID-19.

Analysts said some of the market’s movements could be explained by investors building up expectations for a Joe Biden victory