Stocks waver as Mideast caution grips investors