add support to populate the gridmapdir + bug fixes