Stocks rise on Wall Street, erasing most weekly losses