Stocks showed a lack of direction over the course of the trading day on Thursday but managed to end the session mostly higher. With the gains on the day, the major averages partly offset the steep drop seen in the previous session.