Fixed bugs in a and grid.