Fixed a small bug in grid.