Fix Add.flatten when terms have S.NaN