Fixed bugs in grid.c