Fixed segmentation and inverse issues