Fix step calculation in auto-nesting