BUG: checknan functionality fixed
lines identified as having nan points had wrong indexes.