Improved the mechanism to divert SDigits into a separate file.