Fixing total steps in the after_stage callback.
Fixing bugs in the initialization stage.