Stocks recover much of their early losses on Wall Street