Dow Jones, S&P 500 finish Thursday with slight gains