Fixes incorrect calculation of grid point numbers. The calculation did not take into account the offset of the grid. This has been resolved.