Final cleanup of discretize_geom.