Prepare data only once in segment_properties
Handle negative moments/variance
Add test for negative moments/variance