Fixed a bug with the grid toggle.