Corrected issues with setting values programmatically for ranges