fix grids and trees