Change of return ValueError to raise ValueError in substitutor