Stocks shake off early doubt to make small gains.

NEW YORK After a shaky start, U.S. stocks finished mostly higher Wednesday as technology and industrial companies rose. Banks fell with interest rates as the market came off its biggest loss in five months.

Stocks started lower, then rallied around midday and wandered between gains and losses for several hours before a late-afternoon push.

Technology companies led the market, as they've done throughout this year. Gains for shipping company FedEx helped take industrial companies upward. Nike took its biggest one-day loss in five years as investors were disappointed by its quarterly sales and outlook, and 130-year-old retailer Sears plunged after it said it may not be able to stay in business.

A day ago stocks dropped as Wall Street wondered if key aspects of President Donald Trump's agenda, such as tax cuts and increased infrastructure spending will be delayed. The Republican-backed American Health Care Act appeared to be in trouble ahead of a House of Representatives vote on Thursday.

Terry Simpson, a multi-asset strategist for BlackRock, says it's noteworthy that even though the bill's fate is unclear, stocks didn't fall any further on Wednesday.

"The market really wants to believe in the new administration," he said. But if the bill falters in the House on Thursday or the Senate later on, investors will have "increased doubt in the ability to pass the pro-growth agenda."

The Standard & Poor's 500 index picked up 4.43 points, or 0.2 percent, to 2,348.45. Nike dragged down the Dow Jones industrial average, which fell 6.71 points to 20,661.30. The Nasdaq composite rose 27.82 points, or 0.5 percent, to 5,821.64. The Russell 2000 index of smaller companies sank 0.95 points, or 0.1 percent, to 1,345.60.

Apple gained $1.58, or 1.1 percent, to $141.42 and Microsoft rose 82 cents, or 1.3 percent, to $65.03 while chipmaker Nvidia added $2.16, or 2 percent, to $108.07. The S&P 500's technology index is up 11 percent in 2017, more than double the gain for the broader S&P 500.

Bond prices rose. The yield on the 10-year Treasury note fell to 2.40 percent from 2.42 percent. Lower bond yields mean lower interest rates, and those reduce the profits banks can make from lending.