Nortel swings to a loss