Fixed bug where scanner was returning before reading last row.