Remove old segmentation and fix some other issues with segmentation