Stocks struggle to hold gains as tax bill hits a snag