Fix ThreadedSegment.sleep and .set_interval