Fixed SetVar factory method