Change SegmentPtr to use std::unique_ptr<>