Fixed a problem calculating the grid size.