Logic fix for piecewiseTransform