Fixed JOINCLOSESEGMENT-Added deletion of start/end