U.S. stocks are closing with losses as technology and consumer-focused companies decline.

Facebook shed 2.3 percent and Twitter fell 6.1 percent as top executives from those companies testified before Congress about issues including their efforts to prevent disinformation and election meddling.

Some of the market’s recent leaders also stumbled. Amazon fell 2.2 percent and Microsoft lost 2.9 percent.

The U.S. and Canada restarted talks about a trade deal that would replace the North American Free Trade Agreement.

KEEPING SCORE: The S&P 500 index gave up 8 points, or 0.3 percent, to 2,888. The Dow Jones Industrial Average gained 22 points, or 0.1 percent, to 25,974. The Nasdaq composite shed 96 points, or 1.2 percent, to 7,995. It fell as much as 128 points earlier. The Russell 2000 index of smaller-company stocks lost 7 points, or 0.4 percent, to 1,726.

TECH HEARING: Technology companies were down for the second consecutive day. Executives from Facebook and Twitter are testified to Congress about their efforts trying to root out foreign actors who want to interfere in U.S. elections.

In a separate hearing, Twitter CEO Jack Dorsey is set to reject charges from House Republicans who say his site is biased against conservatives, an accusation they and President Donald Trump have made without evidence.

Twitter fell 4.8 percent to $33.18 and Facebook lost 1.8 percent to $168.08. Snap shed 3.3 percent to $10.24.

FAVORITES FALL: Many of the largest companies on the market and the most successful stocks in 2018 traded lower. Microsoft fell 2.2 percent to $109.29 and Alphabet, Google’s parent company, slid 0.9 percent to $1,199.93.

Among consumer-focused companies, Amazon dropped 1.6 percent to $2,007.73 while Netflix sank 3.9 percent to $349.73.

Technology and consumer-focused stocks have both rallied about 18 percent in 2018, while the S&P 500 is up 8 percent.

THE QUOTE: Julian Emanuel, chief equity and derivative strategist for BTIG, said investors have gotten used to buying tech and consumer stocks whenever they suffer a notable decline. But Wednesday’s hearing comes at a time when investors have more concerns about the stocks than usual.

“The reflex reaction to buy these names on every dip, which has been the case the last few years, has broken,” he said. “That kind of damage takes a bit of time to heal itself.”

Facebook, Netflix and Twitter all plunged about 20 percent in July after they reported weak user growth, and the stocks have yet to recover.

SEEKING SAFETY: Traditionally defensive companies fared better. Utility Southern Co. rose 1.2 percent to $44.41 while PepsiCo gained 1.4 percent to $112.60. Utilities haven’t done as well as the broader S&P 500 this year, while household goods stocks have fallen.

ENERGY: Halliburton CEO Jeffrey Miller said the company is seeing a decrease in North American drilling activity because of customers’ tight budgets, and the decline is worse than it previously expected. It also reported project delays in the Middle East.

Miller said those problems will reduce Halliburton’s third-quarter earnings by 8 to 10 cents a share. The stock fell 5.3 percent to $37.41 and competitor Schlumberger gave up 2 percent to $60.71.

Meanwhile Tropical Storm Gordon changed course and headed east, reducing the risk it will disrupt oil drilling in the Gulf of Mexico.

Benchmark U.S. crude declined 1.4 percent to $68.88 per barrel in New York while Brent crude, used to price international oils, shed 1.2 percent to $77.20 per barrel in London.

VERA GOOD: Clothing and accessories retailer Vera Bradley jumped after it posted strong results in the second quarter and raised its profit forecast for the year. The company said fewer items were marked down, which improved its profit margins. The stock climbed 13.4 percent to $16.21.

Furniture and housewares maker RH fell 11.4 percent to $133.96 after its second-quarter sales came up short of analysts’ projections.

JD DOWN AGAIN: Chinese internet retailer JD.com dropped another 10 percent to $26.50 after a Minneapolis police report showed company founder and CEO Richard Liu was arrested over a felony rape accusation.

The stock fell 6 percent Tuesday, the first trading day after Liu’s arrest was reported. JD.com said Sunday that police found no misconduct, and the company also says Liu has returned to China.

BONDS: Bond prices held steady. The yield on the 10-year Treasury note remained at 2.90 percent.

CURRENCY: The dollar rose to 111.57 yen from 111.48 yen. The euro rose to $1.1625 from $1.1581. The ICE US Dollar index slipped, which helped exporters including industrial and materials companies. The weaker dollar also sent metals prices higher.

Gold rose 0.2 percent to $1,201.30 an ounce. Silver added 0.3 percent to $14.22 an ounce. Copper rose 0.3 percent to $2.61 a pound.

OVERSEAS TRADING: The French CAC 40 fell 1.5 percent while Germany’s DAX lost 1.4 percent. In London the FTSE 100 shed 1 percent.

Tokyo’s Nikkei 225 retreated 0.5 percent and Hong Kong’s Hang Seng dropped 2.6 percent. Seoul’s Kospi declined 1 percent.

© The Associated Press. All rights reserved.