The S&P 500 index closed out an uneven week of trading on Wall Street with its second straight weekly gain, even though stock indexes ended lower Friday.

Technology companies led the slide, which erased the major U.S. indexes’ gains from the day before. Communication services, industrials and health care stocks also fell, outweighing gains in real estate companies, banks and elsewhere in the market.

Investors continued to focus on company earnings reports. They’re searching for a clearer picture on the impact that the trade war between the U.S. and China is having on corporate profits and the broader economy.

“To some extent, the bleeding’s stopped, but now you need to figure out how healthy the patient is,” said Willie Delwiche, investment strategist at Baird. “Earnings help with that, and economic data that we receive over the next couple of months will help with that.”

The S&P 500 index fell 11.75 points, or 0.4%, to 2,986.20. The index is just 1.3% below its all-time high set in late July.

The Dow Jones Industrial Average dropped 255.68 points, or 1%, to 26,770.20. The Nasdaq lost 67.31 points, or 0.8%, to 8,089.54. The Russell 2000 index of smaller stocks gave up 6.36 points, or 0.4%, to 1,535.48.

All told, the S&P 500 ended the week with a gain of 0.5%. Last week, it notched a 0.6% gain.

Smaller stocks outpaced the broader market, a sign that investors are growing more confident. The Russell 2000 ended the week 1.6% higher after rising 0.8% last week.