CPK swings to loss on slow sales, charges