It was a volatile period for stocks. The S&P 500 saw its worst session in eight months, just days after the index reached record highs.