fixed out-of-bound access bug in ScanCells()/ScanCellsParallel()