Improve DEM handling in team_setup_dem.