Changed some "large numbers" from 1e8 and 1e12 to Inf/R_PosInf. This was causing problems if the series had very large numbers.