Fix memory leak in variable setting shortcut