use actual last col
Merge pull request #1 from flyingmachine/master

Use actual last column to identify the last cell of a row.