bug fixes for map2d_grid/set