Stocks make modest gains after days of records