Bug fixes in steps rearrangement