Allow unit to be changed even when original value was outside range.
Merge pull request #2564 from jamalex/unit_setting_fixes

Allow unit to be changed even when original value was outside range.