Duke Energy swings to loss after $1.4 bln charge