Negative margin computation fix