Improved setValue method on Variable