Add segment functionality and warnings.