Index: cmd.c
===================================================================
--- cmd.c	(revision 6a7111370ea0e1de2c3eb86a85f34cd68848d4b1)
+++ cmd.c	(revision f25df21f6284aedd48c098bc68cee9896da5ce98)
@@ -99,11 +99,18 @@
 
 char *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc) {
-  char *buff;
-  char *retval = NULL;
-
-  buff = g_strjoinv(" ", (char**)argv);
-  retval = _owl_cmddict_execute(cd, ctx, argv, argc, buff);
-  g_free(buff);
-
+  GString *buf = g_string_new("");
+  int i;
+  char *retval;
+
+  /* We weren't given a command line, so fabricate a valid one. */
+  for(i = 0; i < argc; i++) {
+    if (i != 0)
+      g_string_append_c(buf, ' ');
+    owl_string_append_quoted_arg(buf, argv[i]);
+  }
+
+  retval = _owl_cmddict_execute(cd, ctx, argv, argc, buf->str);
+
+  g_string_free(buf, true);
   return retval;
 }
Index: functions.c
===================================================================
--- functions.c	(revision 4fd211f3a533efcedaf4d0dc7c01e02087ad2e39)
+++ functions.c	(revision 37d188f0ab60d1503ace959b98cc50cf2a3b69d6)
@@ -2959,5 +2959,5 @@
   
   if (viewsize==0) {
-    owl_function_makemsg("No messages present");
+    owl_function_error("No messages present");
     return;
   }
@@ -2973,5 +2973,5 @@
   /* bounds check */
   if (start>=viewsize || start<0) {
-    owl_function_makemsg("No further matches found");
+    owl_function_error("No further matches found");
     return;
   }
@@ -3002,5 +3002,5 @@
   }
   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
-  owl_function_makemsg("No matches found");
+  owl_function_error("No matches found");
 }
 
Index: owl.c
===================================================================
--- owl.c	(revision 25f7c57210f499abb6780f5a5402c588fc6003eb)
+++ owl.c	(revision 25f7c57210f499abb6780f5a5402c588fc6003eb)
@@ -41,4 +41,5 @@
   char *confdir;
   bool debug;
+  bool rm_debug;
 } owl_options;
 
@@ -49,4 +50,5 @@
   fprintf(stderr, "  -n,--no-subs        don't load zephyr subscriptions\n");
   fprintf(stderr, "  -d,--debug          enable debugging\n");
+  fprintf(stderr, "  -D,--remove-debug   enable debugging and delete previous debug file\n");
   fprintf(stderr, "  -v,--version        print the Barnowl version number and exit\n");
   fprintf(stderr, "  -h,--help           print this help message\n");
@@ -64,4 +66,5 @@
     { "tty",             1, 0, 't' },
     { "debug",           0, 0, 'd' },
+    { "remove-debug",    0, 0, 'D' },
     { "version",         0, 0, 'v' },
     { "help",            0, 0, 'h' },
@@ -85,4 +88,7 @@
       opts->tty = g_strdup(optarg);
       break;
+    case 'D':
+      opts->rm_debug = 1;
+      /* fallthrough */
     case 'd':
       opts->debug = 1;
@@ -503,4 +509,5 @@
   /* owl global init */
   owl_global_init(&g);
+  if (opts.rm_debug) unlink(OWL_DEBUG_FILE);
   if (opts.debug) owl_global_set_debug_on(&g);
   if (opts.confdir) owl_global_set_confdir(&g, opts.confdir);
Index: perlglue.xs
===================================================================
--- perlglue.xs	(revision 6a7111370ea0e1de2c3eb86a85f34cd68848d4b1)
+++ perlglue.xs	(revision f25df21f6284aedd48c098bc68cee9896da5ce98)
@@ -43,6 +43,5 @@
 			rv = owl_function_command(cmd);
 		} else {
-			/* Ensure this is NULL-terminated. */
-			argv = g_new0(const char *, items + 1);
+			argv = g_new(const char *, items + 1);
 			argv[0] = cmd;
 			for(i = 1; i < items; i++) {
Index: variable.c
===================================================================
--- variable.c	(revision f203cad04d71e968a11be5e72e6c9d805e02010d)
+++ variable.c	(revision f25df21f6284aedd48c098bc68cee9896da5ce98)
@@ -30,6 +30,6 @@
         NULL, NULL, NULL, NULL, NULL, NULL }
 
-#define OWLVAR_STRING_FULL(name,default,validset,summary,description,validate,set,get) \
-        { name, OWL_VARIABLE_STRING, default, 0, validset, summary,description, NULL, \
+#define OWLVAR_STRING_FULL(name,default,summary,description,validate,set,get) \
+        { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \
         validate, set, NULL, get, NULL, NULL }
 
@@ -266,5 +266,5 @@
 		 "" ),
 
-  OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "<string>", "tty name for zephyr location", "",
+  OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "tty name for zephyr location", "",
 		      NULL, owl_variable_tty_set, NULL),
 
@@ -370,69 +370,4 @@
 	       "delete a message right as it came in.\n" ),
 
-  OWLVAR_STRING_FULL( "default_exposure" /* %OwlVarStub */, "",
-                      "none,opstaff,realm-visible,realm-announced,net-visible,net-announced",
-                      "controls the persistent value for exposure",
-                      "The default exposure level corresponds to the Zephyr exposure value\n"
-                      "in ~/.zephyr.vars.  Defaults to realm-visible if there is no value in\n"
-                      "~/.zephyr.vars.\n"
-                      "See the description of exposure for the values this can be.",
-                      NULL, owl_variable_default_exposure_set, owl_variable_default_exposure_get ),
-
-  OWLVAR_STRING_FULL( "exposure" /* %OwlVarStub */, "",
-                      "none,opstaff,realm-visible,realm-announced,net-visible,net-announced",
-                      "controls who can zlocate you",
-                      "The exposure level, defaulting to the value of default_exposure,\n"
-                      "can be one of the following (from least exposure to widest exposure,\n"
-                      "as listed in zctl(1)):\n"
-                      "\n"
-                      "   none            - This completely disables Zephyr for the user. \n"
-                      "                     The user is not registered with Zephyr.  No user\n"
-                      "                     location information is retained by Zephyr.  No\n"
-                      "                     login or logout announcements will be sent.  No\n"
-                      "                     subscriptions will be entered for the user, and\n"
-                      "                     no notices will be displayed by zwgc(1).\n"
-                      "   opstaff         - The user is registered with Zephyr.  No login or\n"
-                      "                     logout announcements will be sent, and location\n"
-                      "                     information will only be visible to Operations\n"
-                      "                     staff.  Default subscriptions and any additional\n"
-                      "                     personal subscriptions will be entered for the\n"
-                      "                     user.\n"
-                      "   realm-visible   - The user is registered with Zephyr.  User\n"
-                      "                     location information is retained by Zephyr and\n"
-                      "                     made available only to users within the user’s\n"
-                      "                     Kerberos realm.  No login or logout\n"
-                      "                     announcements will be sent.  This is the system\n"
-                      "                     default.  Default subscriptions and any\n"
-                      "                     additional personal subscriptions will be\n"
-                      "                     entered for the user.\n"
-                      "   realm-announced - The user is registered with Zephyr.  User\n"
-                      "                     location information is retained by Zephyr and\n"
-                      "                     made available only to users authenticated\n"
-                      "                     within the user’s Kerberos realm.  Login and\n"
-                      "                     logout announcements will be sent, but only to\n"
-                      "                     users within the user’s Kerberos realm who have\n"
-                      "                     explicitly requested such via subscriptions. \n"
-                      "                     Default subscriptions and any additional\n"
-                      "                     personal subscriptions will be entered for the\n"
-                      "                     user.\n"
-                      "   net-visible     - The user is registered with Zephyr.  User\n"
-                      "                     location information is retained by Zephyr and\n"
-                      "                     made available to any authenticated user who\n"
-                      "                     requests such.  Login and logout announcements\n"
-                      "                     will be sent only to users within the user’s\n"
-                      "                     Kerberos realm who have explicitly requested\n"
-                      "                     such via subscriptions.  Default subscriptions\n"
-                      "                     and any additional personal subscriptions will\n"
-                      "                     be entered for the user.\n"
-                      "   net-announced   - The user is registered with Zephyr.  User\n"
-                      "                     location information is retained by Zephyr and\n"
-                      "                     made available to any authenticated user who\n"
-                      "                     requests such.  Login and logout announcements\n"
-                      "                     will be sent to any user has requested such. \n"
-                      "                     Default subscriptions and any additional\n"
-                      "                     personal subscriptions will be entered for the\n"
-                      "                     user.\n",
-                      NULL, owl_variable_exposure_set, NULL /* use default for get */ ),
-
   /* This MUST be last... */
   { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL,
@@ -535,21 +470,4 @@
 }
 
-int owl_variable_default_exposure_set(owl_variable *v, const void *newval)
-{
-  return owl_zephyr_set_default_exposure(newval);
-}
-
-const void *owl_variable_default_exposure_get(const owl_variable *v)
-{
-  return owl_zephyr_get_default_exposure();
-}
-
-int owl_variable_exposure_set(owl_variable *v, const void *newval)
-{
-  int ret = owl_zephyr_set_exposure(newval);
-  if (ret != 0)
-    return ret;
-  return owl_variable_string_set_default(v, owl_zephyr_normalize_exposure(newval));
-}
 
 /**************************************************************************/
@@ -770,5 +688,5 @@
   }
   if (msg && v->get_tostring_fn) {
-    tostring = v->get_tostring_fn(v, v->get_fn(v));
+    tostring = v->get_tostring_fn(v, v->val);
     owl_function_makemsg("%s = '%s'", name, tostring);
     g_free(tostring);
@@ -808,5 +726,5 @@
   v = owl_dict_find_element(d, name);
   if (v == NULL || !v->get_tostring_fn) return NULL;
-  return v->get_tostring_fn(v, v->get_fn(v));
+  return v->get_tostring_fn(v, v->val);
 }
 
Index: viewwin.c
===================================================================
--- viewwin.c	(revision 4fd211f3a533efcedaf4d0dc7c01e02087ad2e39)
+++ viewwin.c	(revision 237d02c0b7dc9e5a2f942f7dbcad63b75830350b)
@@ -150,5 +150,5 @@
 
   if (!owl_viewwin_search(v, owl_global_get_search_re(&g), consider_current, direction))
-    owl_function_makemsg("No more matches");
+    owl_function_error("No more matches");
   return NULL;
 }
@@ -172,5 +172,5 @@
   if (!owl_viewwin_search(data->v, owl_global_get_search_re(&g),
                           consider_current, data->direction))
-    owl_function_makemsg("No matches");
+    owl_function_error("No matches");
 }
 
Index: zephyr.c
===================================================================
--- zephyr.c	(revision f203cad04d71e968a11be5e72e6c9d805e02010d)
+++ zephyr.c	(revision cd285178253bae2718490f7635db8c0530f1a4a1)
@@ -1049,8 +1049,19 @@
 {
 #ifdef HAVE_LIBZEPHYR
+  char *exposure, *eset;
+  Code_t ret;
+
   ZResetAuthentication();
 
-  /* ZSetLocation, and store the default value as the current value */
-  owl_global_set_exposure(&g, owl_global_get_default_exposure(&g));
+  eset = EXPOSE_REALMVIS;
+  exposure = ZGetVariable(zstr("exposure"));
+  if (exposure)
+    exposure = ZParseExposureLevel(exposure);
+  if (exposure)
+    eset = exposure;
+   
+  ret = ZSetLocation(eset);
+  if (ret != ZERR_NONE)
+    owl_function_error("Error setting location: %s", error_message(ret));
 #endif
 }
@@ -1173,66 +1184,4 @@
   ZInitLocationInfo(zstr(host), zstr(val));
 #endif
-}
-
-const char *owl_zephyr_normalize_exposure(const char *exposure)
-{
-  if (exposure == NULL)
-    return NULL;
-#ifdef HAVE_LIBZEPHYR
-  return ZParseExposureLevel(zstr(exposure));
-#else
-  return exposure;
-#endif
-}
-
-int owl_zephyr_set_default_exposure(const char *exposure)
-{
-#ifdef HAVE_LIBZEPHYR
-  Code_t ret;
-  if (exposure == NULL)
-    return -1;
-  exposure = ZParseExposureLevel(zstr(exposure));
-  if (exposure == NULL)
-    return -1;
-  ret = ZSetVariable(zstr("exposure"), zstr(exposure)); /* ZSetVariable does file I/O */
-  if (ret != ZERR_NONE) {
-    owl_function_error("Unable to set default exposure location: %s", error_message(ret));
-    return -1;
-  }
-#endif
-  return 0;
-}
-
-const char *owl_zephyr_get_default_exposure(void)
-{
-#ifdef HAVE_LIBZEPHYR
-  const char *exposure = ZGetVariable(zstr("exposure")); /* ZGetVariable does file I/O */
-  if (exposure == NULL)
-    return EXPOSE_REALMVIS;
-  exposure = ZParseExposureLevel(zstr(exposure));
-  if (exposure == NULL) /* The user manually entered an invalid value in ~/.zephyr.vars, or something weird happened. */
-    return EXPOSE_REALMVIS;
-  return exposure;
-#else
-  return "";
-#endif
-}
-
-int owl_zephyr_set_exposure(const char *exposure)
-{
-#ifdef HAVE_LIBZEPHYR
-  Code_t ret;
-  if (exposure == NULL)
-    return -1;
-  exposure = ZParseExposureLevel(zstr(exposure));
-  if (exposure == NULL)
-    return -1;
-  ret = ZSetLocation(zstr(exposure));
-  if (ret != ZERR_NONE) {
-    owl_function_error("Unable to set exposure level: %s.", error_message(ret));
-    return -1;
-  }
-#endif
-  return 0;
 }
   
