Fix a bug in CTHYB_Segment interface and some minor changes