Fix issue with incorrectly determining the last column of data.