S&P 500 ends with slim loss after Fed minutes