Fix substitute script