Fix set_value function. #1106