Index: commands.c
===================================================================
--- commands.c	(revision e6d7e4ea996534cc5a8f0ce69e523114ea38486b)
+++ commands.c	(revision ca54fd61683ca4456f68b3b3758e941cc6d93e24)
@@ -1572,4 +1572,5 @@
   int  silent=0;
   int requirebool=0;
+  owl_variable *v;
 
   if (argc == 1) {
@@ -1594,5 +1595,13 @@
     return NULL;
   }
-  owl_variable_set_fromstring(owl_global_get_vardict(&g), var, val, !silent, requirebool);
+
+  v = owl_variable_get_var(owl_global_get_vardict(&g), var);
+  if (v == NULL) {
+    if (!silent) owl_function_error("Unknown variable '%s'", var);
+  } else if (requirebool && owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
+    if (!silent) owl_function_error("Variable '%s' is not a boolean", var);
+  } else {
+    owl_variable_set_fromstring(v, val, !silent);
+  }
   return NULL;
 }
@@ -1600,4 +1609,5 @@
 char *owl_command_unset(int argc, const char *const *argv, const char *buff)
 {
+  owl_variable *v;
   const char *var, *val;
   int  silent=0;
@@ -1614,5 +1624,13 @@
     return NULL;
   }
-  owl_variable_set_fromstring(owl_global_get_vardict(&g), var, val, !silent, 1);
+
+  v = owl_variable_get_var(owl_global_get_vardict(&g), var);
+  if (v == NULL) {
+    if (!silent) owl_function_error("Unknown variable '%s'", var);
+  } else if (owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
+    if (!silent) owl_function_error("Variable '%s' is not a boolean", var);
+  } else {
+    owl_variable_set_fromstring(v, val, !silent);
+  }
   return NULL;
 }
@@ -1622,4 +1640,5 @@
   const char *var;
   char *value;
+  const owl_variable *v;
 
   if (argc==1) {
@@ -1633,6 +1652,7 @@
   var=argv[1];
     
-  value = owl_variable_get_tostring(owl_global_get_vardict(&g), var);
-  if (value) {
+  v = owl_variable_get_var(owl_global_get_vardict(&g), var);
+  if (v) {
+    value = owl_variable_get_tostring(v);
     owl_function_makemsg("%s = '%s'", var, value);
     g_free(value);
@@ -2505,11 +2525,14 @@
 }
 
-char *owl_command_getvar(int argc, const char *const *argv, const char *buff)
-{
+CALLER_OWN char *owl_command_getvar(int argc, const char *const *argv, const char *buff)
+{
+  const owl_variable *v;
   if (argc != 2) {
     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
     return NULL;
   }
-  return owl_variable_get_tostring(owl_global_get_vardict(&g), argv[1]);
+  v = owl_variable_get_var(owl_global_get_vardict(&g), argv[1]);
+  if (v == NULL) return NULL;
+  return owl_variable_get_tostring(v);
 }
 
Index: functions.c
===================================================================
--- functions.c	(revision b8a3e0025038d7a71f4d13206b772d904f95b8a0)
+++ functions.c	(revision ca54fd61683ca4456f68b3b3758e941cc6d93e24)
@@ -1572,4 +1572,5 @@
 void owl_function_printallvars(void)
 {
+  const owl_variable *v;
   const char *name;
   char *var;
@@ -1585,5 +1586,6 @@
     if (name && name[0]!='_') {
       g_string_append_printf(str, "\n%-20s = ", name);
-      var = owl_variable_get_tostring(owl_global_get_vardict(&g), name);
+      v = owl_variable_get_var(owl_global_get_vardict(&g), name);
+      var = owl_variable_get_tostring(v);
       if (var) {
 	g_string_append(str, var);
@@ -1601,4 +1603,5 @@
 void owl_function_show_variables(void)
 {
+  const owl_variable *v;
   GPtrArray *varnames;
   owl_fmtext fm;  
@@ -1613,5 +1616,6 @@
     varname = varnames->pdata[i];
     if (varname && varname[0]!='_') {
-      owl_variable_describe(owl_global_get_vardict(&g), varname, &fm);
+      v = owl_variable_get_var(owl_global_get_vardict(&g), varname);
+      owl_variable_describe(v, &fm);
     }
   }
@@ -1623,8 +1627,13 @@
 void owl_function_show_variable(const char *name)
 {
+  const owl_variable *v;
   owl_fmtext fm;  
 
   owl_fmtext_init_null(&fm);
-  owl_variable_get_help(owl_global_get_vardict(&g), name, &fm);
+  v = owl_variable_get_var(owl_global_get_vardict(&g), name);
+  if (v)
+    owl_variable_get_help(v, &fm);
+  else
+    owl_fmtext_append_normal(&fm, "No such variable...\n");
   owl_function_popless_fmtext(&fm);
   owl_fmtext_cleanup(&fm);
Index: help.c
===================================================================
--- help.c	(revision ce68f235ae86ae86fa4398ae206bda1194d1fcda)
+++ help.c	(revision ca54fd61683ca4456f68b3b3758e941cc6d93e24)
@@ -4,4 +4,5 @@
 void owl_help(void)
 {
+  const owl_variable *v;
   owl_fmtext fm;
   const char *varname;
@@ -133,5 +134,6 @@
     varname = varnames->pdata[i];
     if (varname && varname[0]!='_') {
-      owl_variable_describe(owl_global_get_vardict(&g), varname, &fm);
+      v = owl_variable_get_var(owl_global_get_vardict(&g), varname);
+      owl_variable_describe(v, &fm);
     }
   }
Index: stubgen.pl
===================================================================
--- stubgen.pl	(revision fd03b12fbdcea4f6b3ebc621c0a85c73d129b088)
+++ stubgen.pl	(revision ca54fd61683ca4456f68b3b3758e941cc6d93e24)
@@ -14,19 +14,19 @@
     if ($vartype =~ /^BOOL/) {
 	print "void owl_global_set_${altvarname}_on(owl_global *g) {\n";
-	print "  owl_variable_set_bool_on(&g->vars, \"$varname\");\n}\n";
+	print "  owl_variable_set_bool_on(owl_variable_get_var(&g->vars, \"$varname\"));\n}\n";
 	print "void owl_global_set_${altvarname}_off(owl_global *g) {\n";
-	print "  owl_variable_set_bool_off(&g->vars, \"$varname\");\n}\n";
+	print "  owl_variable_set_bool_off(owl_variable_get_var(&g->vars, \"$varname\"));\n}\n";
 	print "int owl_global_is_$altvarname(const owl_global *g) {\n";
-	print "  return owl_variable_get_bool(&g->vars, \"$varname\");\n}\n";
+	print "  return owl_variable_get_bool(owl_variable_get_var(&g->vars, \"$varname\"));\n}\n";
     } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) {
 	print "void owl_global_set_$altvarname(owl_global *g, const char *text) {\n";
-	print "  owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n";
+	print "  owl_variable_set_string(owl_variable_get_var(&g->vars, \"$varname\"), text);\n}\n";
 	print "const char *owl_global_get_$altvarname(const owl_global *g) {\n";
-	print "  return owl_variable_get_string(&g->vars, \"$varname\");\n}\n";
+	print "  return owl_variable_get_string(owl_variable_get_var(&g->vars, \"$varname\"));\n}\n";
     } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) {
 	print "void owl_global_set_$altvarname(owl_global *g, int n) {\n";
-	print "  owl_variable_set_int(&g->vars, \"$varname\", n);\n}\n";
+	print "  owl_variable_set_int(owl_variable_get_var(&g->vars, \"$varname\"), n);\n}\n";
 	print "int owl_global_get_$altvarname(const owl_global *g) {\n";
-	print "  return owl_variable_get_int(&g->vars, \"$varname\");\n}\n";
+	print "  return owl_variable_get_int(owl_variable_get_var(&g->vars, \"$varname\"));\n}\n";
     } 
     }
Index: tester.c
===================================================================
--- tester.c	(revision bc1d64834a2b9c92b2d947386c6bc93921e3c037)
+++ tester.c	(revision ca54fd61683ca4456f68b3b3758e941cc6d93e24)
@@ -276,4 +276,5 @@
 int owl_variable_regtest(void) {
   owl_vardict vd;
+  owl_variable *var;
   int numfailed=0;
   char *value;
@@ -283,53 +284,59 @@
   FAIL_UNLESS("setup", 0==owl_variable_dict_setup(&vd));
 
-  FAIL_UNLESS("get bool", 0==owl_variable_get_bool(&vd,"rxping"));
-  FAIL_UNLESS("get bool (no such)", -1==owl_variable_get_bool(&vd,"mumble"));
+  FAIL_UNLESS("get bool var", NULL != (var = owl_variable_get_var(&vd, "rxping")));
+  FAIL_UNLESS("get bool", 0 == owl_variable_get_bool(var));
+  FAIL_UNLESS("get bool (no such)", NULL == owl_variable_get_var(&vd, "mumble"));
   FAIL_UNLESS("get bool as string",
-	      !strcmp((value = owl_variable_get_tostring(&vd,"rxping")), "off"));
+	      !strcmp((value = owl_variable_get_tostring(var)), "off"));
   g_free(value);
-  FAIL_UNLESS("set bool 1", 0==owl_variable_set_bool_on(&vd,"rxping"));
-  FAIL_UNLESS("get bool 2", 1==owl_variable_get_bool(&vd,"rxping"));
-  FAIL_UNLESS("set bool 3", 0==owl_variable_set_fromstring(&vd,"rxping","off",0,0));
-  FAIL_UNLESS("get bool 4", 0==owl_variable_get_bool(&vd,"rxping"));
-  FAIL_UNLESS("set bool 5", -1==owl_variable_set_fromstring(&vd,"rxping","xxx",0,0));
-  FAIL_UNLESS("get bool 6", 0==owl_variable_get_bool(&vd,"rxping"));
-
-
-  FAIL_UNLESS("get string", 0==strcmp("~/zlog/people", owl_variable_get_string(&vd,"logpath")));
-  FAIL_UNLESS("set string 7", 0==owl_variable_set_string(&vd,"logpath","whee"));
-  FAIL_UNLESS("get string", 0==strcmp("whee", owl_variable_get_string(&vd,"logpath")));
-
-  FAIL_UNLESS("get int", 8==owl_variable_get_int(&vd,"typewinsize"));
-  FAIL_UNLESS("get int (no such)", -1==owl_variable_get_int(&vd,"mmble"));
+  FAIL_UNLESS("set bool 1", 0 == owl_variable_set_bool_on(var));
+  FAIL_UNLESS("get bool 2", 1 == owl_variable_get_bool(var));
+  FAIL_UNLESS("set bool 3", 0 == owl_variable_set_fromstring(var, "off", 0));
+  FAIL_UNLESS("get bool 4", 0 == owl_variable_get_bool(var));
+  FAIL_UNLESS("set bool 5", -1 == owl_variable_set_fromstring(var, "xxx", 0));
+  FAIL_UNLESS("get bool 6", 0 == owl_variable_get_bool(var));
+
+
+  FAIL_UNLESS("get string var", NULL != (var = owl_variable_get_var(&vd, "logpath")));
+  FAIL_UNLESS("get string", 0 == strcmp("~/zlog/people", owl_variable_get_string(var)));
+  FAIL_UNLESS("set string 7", 0 == owl_variable_set_string(var, "whee"));
+  FAIL_UNLESS("get string", !strcmp("whee", owl_variable_get_string(var)));
+
+  FAIL_UNLESS("get int var", NULL != (var = owl_variable_get_var(&vd, "typewinsize")));
+  FAIL_UNLESS("get int", 8 == owl_variable_get_int(var));
+  FAIL_UNLESS("get int (no such)", NULL == owl_variable_get_var(&vd, "mumble"));
   FAIL_UNLESS("get int as string",
-	      !strcmp((value = owl_variable_get_tostring(&vd,"typewinsize")), "8"));
+	      !strcmp((value = owl_variable_get_tostring(var)), "8"));
   g_free(value);
-  FAIL_UNLESS("set int 1", 0==owl_variable_set_int(&vd,"typewinsize",12));
-  FAIL_UNLESS("get int 2", 12==owl_variable_get_int(&vd,"typewinsize"));
-  FAIL_UNLESS("set int 1b", -1==owl_variable_set_int(&vd,"typewinsize",-3));
-  FAIL_UNLESS("get int 2b", 12==owl_variable_get_int(&vd,"typewinsize"));
-  FAIL_UNLESS("set int 3", 0==owl_variable_set_fromstring(&vd,"typewinsize","9",0,0));
-  FAIL_UNLESS("get int 4", 9==owl_variable_get_int(&vd,"typewinsize"));
-  FAIL_UNLESS("set int 5", -1==owl_variable_set_fromstring(&vd,"typewinsize","xxx",0,0));
-  FAIL_UNLESS("set int 6", -1==owl_variable_set_fromstring(&vd,"typewinsize","",0,0));
-  FAIL_UNLESS("get int 7", 9==owl_variable_get_int(&vd,"typewinsize"));
+  FAIL_UNLESS("set int 1", 0 == owl_variable_set_int(var, 12));
+  FAIL_UNLESS("get int 2", 12 == owl_variable_get_int(var));
+  FAIL_UNLESS("set int 1b", -1 == owl_variable_set_int(var, -3));
+  FAIL_UNLESS("get int 2b", 12 == owl_variable_get_int(var));
+  FAIL_UNLESS("set int 3", 0 == owl_variable_set_fromstring(var, "9", 0));
+  FAIL_UNLESS("get int 4", 9 == owl_variable_get_int(var));
+  FAIL_UNLESS("set int 5", -1 == owl_variable_set_fromstring(var, "xxx", 0));
+  FAIL_UNLESS("set int 6", -1 == owl_variable_set_fromstring(var, "", 0));
+  FAIL_UNLESS("get int 7", 9 == owl_variable_get_int(var));
 
   owl_variable_dict_newvar_string(&vd, "stringvar", "", "", "testval");
-  FAIL_UNLESS("get new string var", NULL != (v = owl_variable_get(&vd, "stringvar")));
-  FAIL_UNLESS("get new string val", !strcmp("testval", owl_variable_get_string(&vd, "stringvar")));
-  owl_variable_set_string(&vd, "stringvar", "new val");
-  FAIL_UNLESS("update string val", !strcmp("new val", owl_variable_get_string(&vd, "stringvar")));
+  FAIL_UNLESS("get new string var", NULL != (var = owl_variable_get_var(&vd, "stringvar")));
+  FAIL_UNLESS("get new string var", NULL != (v = owl_variable_get(var)));
+  FAIL_UNLESS("get new string val", !strcmp("testval", owl_variable_get_string(var)));
+  owl_variable_set_string(var, "new val");
+  FAIL_UNLESS("update string val", !strcmp("new val", owl_variable_get_string(var)));
 
   owl_variable_dict_newvar_int(&vd, "intvar", "", "", 47);
-  FAIL_UNLESS("get new int var", NULL != (v = owl_variable_get(&vd, "intvar")));
-  FAIL_UNLESS("get new int val", 47 == owl_variable_get_int(&vd, "intvar"));
-  owl_variable_set_int(&vd, "intvar", 17);
-  FAIL_UNLESS("update bool val", 17 == owl_variable_get_int(&vd, "intvar"));
+  FAIL_UNLESS("get new int var", NULL != (var = owl_variable_get_var(&vd, "intvar")));
+  FAIL_UNLESS("get new int var", NULL != (v = owl_variable_get(var)));
+  FAIL_UNLESS("get new int val", 47 == owl_variable_get_int(var));
+  owl_variable_set_int(var, 17);
+  FAIL_UNLESS("update int val", 17 == owl_variable_get_int(var));
 
   owl_variable_dict_newvar_bool(&vd, "boolvar", "", "", 1);
-  FAIL_UNLESS("get new bool var", NULL != (v = owl_variable_get(&vd, "boolvar")));
-  FAIL_UNLESS("get new bool val", owl_variable_get_bool(&vd, "boolvar"));
-  owl_variable_set_bool_off(&vd, "boolvar");
-  FAIL_UNLESS("update string val", !owl_variable_get_bool(&vd, "boolvar"));
+  FAIL_UNLESS("get new bool var", NULL != (var = owl_variable_get_var(&vd, "boolvar")));
+  FAIL_UNLESS("get new bool var", NULL != (v = owl_variable_get(var)));
+  FAIL_UNLESS("get new bool val", owl_variable_get_bool(var));
+  owl_variable_set_bool_off(var);
+  FAIL_UNLESS("update bool val", !owl_variable_get_bool(var));
 
   owl_variable_dict_cleanup(&vd);
Index: variable.c
===================================================================
--- variable.c	(revision bc1d64834a2b9c92b2d947386c6bc93921e3c037)
+++ variable.c	(revision ca54fd61683ca4456f68b3b3758e941cc6d93e24)
@@ -665,5 +665,5 @@
 {
   owl_variable *old = owl_variable_get_var(vd, name);
-  if (old && old->type == OWL_VARIABLE_STRING) {
+  if (old && owl_variable_get_type(old) == OWL_VARIABLE_STRING) {
     owl_variable_update(old, summ, desc);
     g_free(old->pval_default);
@@ -686,5 +686,5 @@
 {
   owl_variable *old = owl_variable_get_var(vd, name);
-  if (old && old->type == OWL_VARIABLE_INT) {
+  if (old && owl_variable_get_type(old) == OWL_VARIABLE_INT) {
     owl_variable_update(old, summ, desc);
     old->ival_default = initval;
@@ -708,5 +708,5 @@
 {
   owl_variable *old = owl_variable_get_var(vd, name);
-  if (old && old->type == OWL_VARIABLE_BOOL) {
+  if (old && owl_variable_get_type(old) == OWL_VARIABLE_BOOL) {
     owl_variable_update(old, summ, desc);
     old->ival_default = initval;
@@ -753,4 +753,9 @@
 
 
+const char *owl_variable_get_name(const owl_variable *v)
+{
+  return v->name;
+}
+
 const char *owl_variable_get_description(const owl_variable *v) {
   return v->description;
@@ -769,32 +774,26 @@
 }
 
+int owl_variable_get_type(const owl_variable *v)
+{
+  return v->type;
+}
+
 /* functions for getting and setting variable values */
 
 /* returns 0 on success, prints a status msg if msg is true */
-int owl_variable_set_fromstring(owl_vardict *d, const char *name, const char *value, int msg, int requirebool) {
-  owl_variable *v;
+int owl_variable_set_fromstring(owl_variable *v, const char *value, int msg) {
   char *tostring;
-  if (!name) return(-1);
-  v = owl_dict_find_element(d, name);
-  if (v == NULL) {
-    if (msg) owl_function_error("Unknown variable %s", name);
-    return -1;
-  }
   if (!v->set_fromstring_fn) {
-    if (msg) owl_function_error("Variable %s is read-only", name);
+    if (msg) owl_function_error("Variable %s is read-only", owl_variable_get_name(v));
     return -1;   
   }
-  if (requirebool && v->type!=OWL_VARIABLE_BOOL) {
-    if (msg) owl_function_error("Variable %s is not a boolean", name);
-    return -1;   
-  }
   if (0 != v->set_fromstring_fn(v, value)) {
-    if (msg) owl_function_error("Unable to set %s (must be %s)", name, 
-				  owl_variable_get_validsettings(v));
+    if (msg) owl_function_error("Unable to set %s (must be %s)", owl_variable_get_name(v),
+                                owl_variable_get_validsettings(v));
     return -1;
   }
   if (msg && v->get_tostring_fn) {
     tostring = v->get_tostring_fn(v, v->get_fn(v));
-    owl_function_makemsg("%s = '%s'", name, tostring);
+    owl_function_makemsg("%s = '%s'", owl_variable_get_name(v), tostring);
     g_free(tostring);
   }    
@@ -802,45 +801,35 @@
 }
  
-int owl_variable_set_string(owl_vardict *d, const char *name, const char *newval) {
-  owl_variable *v;
-  if (!name) return(-1);
-  v = owl_dict_find_element(d, name);
-  if (v == NULL || !v->set_fn) return(-1);
-  if (v->type!=OWL_VARIABLE_STRING) return(-1);
+int owl_variable_set_string(owl_variable *v, const char *newval)
+{
+  if (v->type != OWL_VARIABLE_STRING) return -1;
   return v->set_fn(v, newval);
 }
  
-int owl_variable_set_int(owl_vardict *d, const char *name, int newval) {
-  owl_variable *v;
-  if (!name) return(-1);
-  v = owl_dict_find_element(d, name);
-  if (v == NULL || !v->set_fn) return(-1);
-  if (v->type!=OWL_VARIABLE_INT && v->type!=OWL_VARIABLE_BOOL) return(-1);
+int owl_variable_set_int(owl_variable *v, int newval)
+{
+  if (v->type != OWL_VARIABLE_INT && v->type != OWL_VARIABLE_BOOL) return -1;
   return v->set_fn(v, &newval);
 }
  
-int owl_variable_set_bool_on(owl_vardict *d, const char *name) {
-  return owl_variable_set_int(d,name,1);
-}
-
-int owl_variable_set_bool_off(owl_vardict *d, const char *name) {
-  return owl_variable_set_int(d,name,0);
-}
-
-CALLER_OWN char *owl_variable_get_tostring(const owl_vardict *d, const char *name)
-{
-  owl_variable *v;
-  if (!name) return NULL;
-  v = owl_dict_find_element(d, name);
-  if (v == NULL || !v->get_tostring_fn) return NULL;
+int owl_variable_set_bool_on(owl_variable *v)
+{
+  if (v->type != OWL_VARIABLE_BOOL) return -1;
+  return owl_variable_set_int(v, true);
+}
+
+int owl_variable_set_bool_off(owl_variable *v)
+{
+  if (v->type != OWL_VARIABLE_BOOL) return -1;
+  return owl_variable_set_int(v, false);
+}
+
+CALLER_OWN char *owl_variable_get_tostring(const owl_variable *v)
+{
   return v->get_tostring_fn(v, v->get_fn(v));
 }
 
-CALLER_OWN char *owl_variable_get_default_tostring(const owl_vardict *d, const char *name)
-{
-  owl_variable *v;
-  if (!name) return NULL;
-  v = owl_dict_find_element(d, name);
-  if (v == NULL || !v->get_tostring_fn) return NULL;
+CALLER_OWN char *owl_variable_get_default_tostring(const owl_variable *v)
+{
   if (v->type == OWL_VARIABLE_INT || v->type == OWL_VARIABLE_BOOL) {
     return v->get_tostring_fn(v, &(v->ival_default));
@@ -860,78 +849,72 @@
 
 /* returns a reference */
-const void *owl_variable_get(const owl_vardict *d, const char *name)
-{
-  const owl_variable *v = owl_variable_get_var(d, name);
-  if(v == NULL) return NULL;
+const void *owl_variable_get(const owl_variable *v)
+{
   return v->get_fn(v);
 }
 
+const char *owl_variable_get_string(const owl_variable *v)
+{
+  if (owl_variable_get_type(v) != OWL_VARIABLE_STRING) {
+    owl_function_error("Variable '%s' is not a string.", owl_variable_get_name(v));
+    return NULL;
+  }
+  return owl_variable_get(v);
+}
+
 /* returns a reference */
-const char *owl_variable_get_string(const owl_vardict *d, const char *name) {
-  /* TODO: (Decide whether or not to) type check? */
-  return owl_variable_get(d, name);
-}
-
-/* returns a reference */
-const void *owl_variable_get_other(const owl_vardict *d, const char *name) {
-  /* TODO: (Decide whether or not to) type check? */
-  return owl_variable_get(d, name);
-}
-
-int owl_variable_get_int(const owl_vardict *d, const char *name) {
-  /* TODO: (Decide whether or not to) type check? */
-  const int *pi = owl_variable_get(d, name);
+const void *owl_variable_get_other(const owl_variable *v)
+{
+  if (owl_variable_get_type(v) != OWL_VARIABLE_OTHER) {
+    owl_function_error("Variable '%s' is not type other.", owl_variable_get_name(v));
+    return NULL;
+  }
+  return owl_variable_get(v);
+}
+
+int owl_variable_get_int(const owl_variable *v)
+{
+  if (owl_variable_get_type(v) != OWL_VARIABLE_INT) {
+    owl_function_error("Variable '%s' is an int.", owl_variable_get_name(v));
+    return -1;
+  }
+  const int *pi = owl_variable_get(v);
   if (!pi) return -1;
   return *pi;
 }
 
-int owl_variable_get_bool(const owl_vardict *d, const char *name) {
-  /* TODO: (Decide whether or not to) type check? */
-  const int *pi = owl_variable_get(d, name);
+int owl_variable_get_bool(const owl_variable *v)
+{
+  if (owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
+    owl_function_error("Variable '%s' is a boolean.", owl_variable_get_name(v));
+    return -1;
+  }
+  const int *pi = owl_variable_get(v);
   if (!pi) return -1;
   return *pi;
 }
 
-void owl_variable_describe(const owl_vardict *d, const char *name, owl_fmtext *fm) {
-  char *default_buf;
-  owl_variable *v;
-
-  if (!name
-      || (v = owl_dict_find_element(d, name)) == NULL 
-      || !v->get_fn) {
-    owl_fmtext_appendf_normal(fm, "     No such variable '%s'\n", name);
-    return;
-  }
-  if (v->type == OWL_VARIABLE_INT || v->type == OWL_VARIABLE_BOOL) {
-    default_buf = v->get_tostring_fn(v, &(v->ival_default));
-  } else {
-    default_buf = v->get_tostring_fn(v, v->pval_default);
-  }
+void owl_variable_describe(const owl_variable *v, owl_fmtext *fm)
+{
+  char *default_buf = owl_variable_get_default_tostring(v);
+
   owl_fmtext_appendf_normal(fm, OWL_TABSTR "%-20s - %s (default: '%s')\n",
-			    v->name,
+			    owl_variable_get_name(v),
 			    owl_variable_get_summary(v), default_buf);
   g_free(default_buf);
 }
 
-void owl_variable_get_help(const owl_vardict *d, const char *name, owl_fmtext *fm) {
+void owl_variable_get_help(const owl_variable *v, owl_fmtext *fm) {
   char *tostring;
-  owl_variable *v;
-
-  if (!name
-      || (v = owl_dict_find_element(d, name)) == NULL 
-      || !v->get_fn) {
-    owl_fmtext_append_normal(fm, "No such variable...\n");
-    return;
-  }
 
   owl_fmtext_append_bold(fm, "OWL VARIABLE\n\n");
   owl_fmtext_append_normal(fm, OWL_TABSTR);
-  owl_fmtext_append_normal(fm, name);
+  owl_fmtext_append_normal(fm, owl_variable_get_name(v));
   owl_fmtext_append_normal(fm, " - ");
-  owl_fmtext_append_normal(fm, v->summary);
+  owl_fmtext_append_normal(fm, owl_variable_get_summary(v));
   owl_fmtext_append_normal(fm, "\n\n");
 
   owl_fmtext_append_normal(fm, "Current:        ");
-  tostring = owl_variable_get_tostring(d, name);
+  tostring = owl_variable_get_tostring(v);
   owl_fmtext_append_normal(fm, tostring);
   g_free(tostring);
@@ -939,9 +922,5 @@
 
 
-  if (v->type == OWL_VARIABLE_INT || v->type == OWL_VARIABLE_BOOL) {
-    tostring = v->get_tostring_fn(v, &(v->ival_default));
-  } else {
-    tostring = v->get_tostring_fn(v, v->pval_default);
-  }
+  tostring = owl_variable_get_default_tostring(v);
   owl_fmtext_append_normal(fm, "Default:        ");
   owl_fmtext_append_normal(fm, tostring);
