Fixing the step deletion bug