Updates script replacement starategy to preserve script dependencies