Fixing bugs in new grid framework