Fixed bugs in new grid class