Stocks ended with meager gains on Wall Street Wednesday, stabilizing after a sell-off in tech stocks a day earlier.

It’s the latest turbulence for the market as traders brace for more earnings reports from major U.S. companies. The S&P 500 saw most of a midday rally evaporate and wound up with a slight gain. A tech recovery also petered out, leaving the Nasdaq just barely in the red.

Visa surged after reporting better-than-expected earnings. Boeing slumped after reporting a much bigger loss than Wall Street anticipated.

On Wednesday:

The S&P 500 rose 8.76 points, or 0.2%, to 4,183.96.

The Dow Jones Industrial Average rose 61.75 points, or 0.2%, to 33,301.93.

The Nasdaq fell 1.81 points, or less than 0.1%, to 12,488.93.

The Russell 2000 index of smaller companies fell 6.44 points, or 0.3%, to 1,884.04.

For the week:

The S&P 500 is down 87.82 points, or 2.1%.

The Dow is down 509.47 points, or 1.5%.

The Nasdaq is down 350.36 points, or 2.7%.

The Russell 2000 is down 56.63 points, or 2.9%.

For the year:

The S&P 500 is down 582.22 points, or 12.2%.

The Dow is down 3,036.37 points, or 8.4%.

The Nasdaq is down 3,156.04 points, or 20.2%.

The Russell 2000 is down 361.27 points, or 16.1%.