Fix to the Set Value function