US close: Stocks end the day with modest gains