Fix bugs in stepper