Stocks rebounded for a second day on Wednesday as investors snapped up beaten-down technology and internet favorites and strong company results lifted spirits, even as the S&P 500 closed out its worst month in seven years.

The S&P 500 lost 6.9 percent in October, while the Nasdaq shed 9.2 percent, its biggest monthly loss since November 2008.

Fears of rising borrowing costs, global trade disputes and a possible slowdown in U.S. corporate profits spooked equity investors this month, with technology and internet names that had powered the market’s rally taking the biggest hit.

On Wednesday, shares of Facebook Inc (FB.O) gained 3.8 percent after the social media giant said margins would stop shrinking after 2019 as costs from scandals ease.

The S&P communication services index, which also includes Alphabet and Netflix, rose 2.1 percent. The S&P technology index ended the trading day up 2.4 percent.

Shares of Amazon and Apple, which is due to report results after the bell on Thursday, were up 4.4 percent and 2.6 percent respectively.

The Nasdaq gained 3.6 percent in the last two sessions, its largest two-day percentage gain since June 2016.

General Motors was up 9.1 percent to notch its largest one-day gain since late May, after the company posted robust quarterly results and forecast strong full-year earnings.

The Cboe Volatility Index had its lowest close since Oct. 23.

The Dow lost 5.1 percent for the month, its largest monthly percentage decline since January 2016.

October also marked only the 12th time since the start of the current equity bull market that both stocks and Treasury bonds produced losses in the same month, based on preliminary data.

Mostly stronger-than-expected results have pushed up third-quarter earnings growth estimates for S&P 500 companies to 26.3 percent, according to I/B/E/S data from Refinitiv data.

Defensive sectors were the only decliners. The S&P consumer staples index fell 0.9 percent.

Shares of Kellogg fell 8.9 percent after the company reduced its full-year earnings forecast due to higher advertising and distribution costs.

The financial sector index rose 1.4 percent and the S&P 500 regional banks index gained 1.9 percent, on the Federal Reserve’s proposal to ease regulations for U.S. banks with less than $700 billion in assets.

Approximately 9.8 billion shares changed hands on the major domestic equity exchanges, as compared to the 8.7 billion-share daily average for the past 20 trading days.

Bonds Are Not the Place to Be

It may well be time to write an obituary for what is usually called a “balanced” investment portfolio. October has been unusually cruel to people invested in both stocks and bonds on the assumption that one will rise while the other falls.

The month marked only the 12th time since the March 2009 dawn of the bull market that stocks, and bonds fell in tandem. A nasty statistic for those who hoped their investments would hold their value while they live on the dividends stocks pay and the coupons bonds offer.

Bonds did badly because of the jump in yields as benchmark the 10-year Treasury note yields hit a 7-1/2-year high. Stocks fell because of rising U.S.-China trade tensions.

Mutual fund and exchange-traded fund investors responded to the market slide by retreating, pulling out more than $14 billion of both stocks and bonds, according to Refinitiv’s Lipper research service.

The rest of the year will continue to test investors, with a congressional election next month, further talks on U.S.-China trade issues and little clarity about whether the Fed will pull back on efforts to tighten monetary policy.

The simultaneous slide has even hurt institutional investors and hedge funds that hold both stocks and debt and look to balance their risk, such as “risk parity” funds.