Found bug when Nan is in the input sequence