Fix VariableTree editing bug, use set() in place of direct assignment.