Indexes wavered between small gains and losses for most of the day, but took a decisive turn lower in the last hour of trading. That made this the worst week since September 2011, when the market was roiled by the fight over the U.S. debt ceiling and Standard & Poor's move to cut the credit rating of the U.S. government.