Fix bug in xseg_leave()