Fix bug for previous steps in merge case