SegmentSet: fixed various bugs and added suppport for multiple buffers