Rewrite map_init_flattened.