Refactor autoAbort and fix computation of slope