Fixes bugs in stepping