changeset 20939:b17fda023ca6

maint: Use new C++ archetype in more files. Place input validation first in files. Move declaration of retval down in function to be closer to point of usage. Eliminate else clause after if () error. Use "return ovl()" where it makes sense. * find.cc, gammainc.cc, gcd.cc, getgrent.cc, getpwent.cc, givens.cc, graphics.cc, help.cc, hess.cc, hex2num.cc, input.cc, kron.cc, load-path.cc, load-save.cc, lookup.cc, mappers.cc, matrix_type.cc, mgorth.cc, nproc.cc, ordschur.cc, pager.cc, pinv.cc, pr-output.cc, profiler.cc, psi.cc, quad.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc, sparse.cc, str2double.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc, tril.cc, tsearch.cc, typecast.cc, urlwrite.cc, utils.cc, variables.cc, __delaunayn__.cc, __eigs__.cc, __glpk__.cc, __magick_read__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, chol.cc, colamd.cc, dmperm.cc, fftw.cc, qr.cc, symbfact.cc, symrcm.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-flt-re-mat.cc, ov-java.cc, ov-null-mat.cc, ov-oncleanup.cc, ov-re-mat.cc, ov-struct.cc, ov-typeinfo.cc, ov-usr-fcn.cc, ov.cc, octave.cc: Use new C++ archetype in more files.
author Rik <rik@octave.org>
date Fri, 18 Dec 2015 15:37:22 -0800
parents aac911d8847b
children 48b2ad5ee801
files libinterp/corefcn/find.cc libinterp/corefcn/gammainc.cc libinterp/corefcn/gcd.cc libinterp/corefcn/getgrent.cc libinterp/corefcn/getpwent.cc libinterp/corefcn/givens.cc libinterp/corefcn/graphics.cc libinterp/corefcn/help.cc libinterp/corefcn/hess.cc libinterp/corefcn/hex2num.cc libinterp/corefcn/input.cc libinterp/corefcn/kron.cc libinterp/corefcn/load-path.cc libinterp/corefcn/load-save.cc libinterp/corefcn/lookup.cc libinterp/corefcn/mappers.cc libinterp/corefcn/matrix_type.cc libinterp/corefcn/mgorth.cc libinterp/corefcn/nproc.cc libinterp/corefcn/ordschur.cc libinterp/corefcn/pager.cc libinterp/corefcn/pinv.cc libinterp/corefcn/pr-output.cc libinterp/corefcn/profiler.cc libinterp/corefcn/psi.cc libinterp/corefcn/quad.cc libinterp/corefcn/rcond.cc libinterp/corefcn/regexp.cc libinterp/corefcn/schur.cc libinterp/corefcn/sighandlers.cc libinterp/corefcn/sparse.cc libinterp/corefcn/str2double.cc libinterp/corefcn/strfind.cc libinterp/corefcn/strfns.cc libinterp/corefcn/sub2ind.cc libinterp/corefcn/svd.cc libinterp/corefcn/sylvester.cc libinterp/corefcn/symtab.cc libinterp/corefcn/syscalls.cc libinterp/corefcn/sysdep.cc libinterp/corefcn/time.cc libinterp/corefcn/toplev.cc libinterp/corefcn/tril.cc libinterp/corefcn/tsearch.cc libinterp/corefcn/typecast.cc libinterp/corefcn/urlwrite.cc libinterp/corefcn/utils.cc libinterp/corefcn/variables.cc libinterp/dldfcn/__delaunayn__.cc libinterp/dldfcn/__eigs__.cc libinterp/dldfcn/__glpk__.cc libinterp/dldfcn/__magick_read__.cc libinterp/dldfcn/__osmesa_print__.cc libinterp/dldfcn/__voronoi__.cc libinterp/dldfcn/amd.cc libinterp/dldfcn/audiodevinfo.cc libinterp/dldfcn/audioread.cc libinterp/dldfcn/chol.cc libinterp/dldfcn/colamd.cc libinterp/dldfcn/dmperm.cc libinterp/dldfcn/fftw.cc libinterp/dldfcn/qr.cc libinterp/dldfcn/symbfact.cc libinterp/dldfcn/symrcm.cc libinterp/octave-value/ov-bool-mat.cc libinterp/octave-value/ov-cell.cc libinterp/octave-value/ov-class.cc libinterp/octave-value/ov-classdef.cc libinterp/octave-value/ov-fcn-handle.cc libinterp/octave-value/ov-fcn-inline.cc libinterp/octave-value/ov-flt-re-mat.cc libinterp/octave-value/ov-java.cc libinterp/octave-value/ov-null-mat.cc libinterp/octave-value/ov-oncleanup.cc libinterp/octave-value/ov-re-mat.cc libinterp/octave-value/ov-struct.cc libinterp/octave-value/ov-typeinfo.cc libinterp/octave-value/ov-usr-fcn.cc libinterp/octave-value/ov.cc libinterp/octave.cc
diffstat 80 files changed, 2032 insertions(+), 2600 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/find.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/find.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -383,11 +383,9 @@
 @seealso{nonzeros}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
-  if (nargin > 3 || nargin < 1)
+  if (nargin < 1 || nargin > 3)
     print_usage ();
 
   // Setup the default options.
@@ -414,11 +412,12 @@
         direction = 1;
       else if (s_arg == "last")
         direction = -1;
-
-      if (direction == 0)
+      else
         error ("find: DIRECTION must be \"first\" or \"last\"");
     }
 
+  octave_value_list retval;
+
   octave_value arg = args(0);
 
   if (arg.is_bool_type ())
@@ -435,9 +434,7 @@
           // matrix. Try to reuse the possibly cached index vector.
 
           // No need to catch index_exception, since arg is bool.
-          // Out-of-range errors have already set pos, and will be
-          // caught later.
-
+          // Out-of-range errors have already set pos, and will be caught later.
           retval(0) = arg.index_vector ().unmask ();
         }
       else
--- a/libinterp/corefcn/gammainc.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/gammainc.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -78,14 +78,12 @@
 @seealso{gamma, gammaln}\n\
 @end deftypefn")
 {
-  octave_value retval;
-  bool lower = true;
-
   int nargin = args.length ();
 
   if (nargin < 2 || nargin > 3)
     print_usage ();
 
+  bool lower = true;
   if (nargin == 3)
     {
       std::string s = args(2).xstring_value ("gammainc: third argument must be \"lower\" or \"upper\"");
@@ -94,10 +92,14 @@
 
       if (s == "upper")
         lower = false;
-      else if (s != "lower")
+      else if (s == "lower")
+        lower = true;
+      else
         error ("gammainc: third argument must be \"lower\" or \"upper\"");
     }
 
+  octave_value retval;
+
   octave_value x_arg = args(0);
   octave_value a_arg = args(1);
 
--- a/libinterp/corefcn/gcd.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/gcd.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -472,13 +472,13 @@
 @seealso{lcm, factor, isprime}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin < 2)
     print_usage ();
 
+  octave_value_list retval;
+
   if (nargout > 1)
     {
       retval.resize (nargin + 1);
@@ -488,8 +488,7 @@
       for (int j = 2; j < nargin; j++)
         {
           octave_value x;
-          retval(0) = do_extended_gcd (retval(0), args(j),
-                                       x, retval(j+1));
+          retval(0) = do_extended_gcd (retval(0), args(j), x, retval(j+1));
           for (int i = 0; i < j; i++)
             retval(i+1).assign (octave_value::op_el_mul_eq, x);
         }
--- a/libinterp/corefcn/getgrent.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/getgrent.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -71,8 +71,6 @@
 @seealso{setgrent, endgrent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
@@ -81,9 +79,7 @@
   // octave_group::getgrent may set msg.
   octave_value val = mk_gr_map (octave_group::getgrent (msg));
 
-  retval = ovl (val, msg);
-
-  return retval;
+  return ovl (val, msg);
 }
 
 DEFUN (getgrgid, args, ,
@@ -96,29 +92,22 @@
 @seealso{getgrnam}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
   double dval = args(0).double_value ();
 
-  if (D_NINT (dval) == dval)
-    {
-      gid_t gid = static_cast<gid_t> (dval);
-
-      std::string msg;
-
-      // octave_group::getgrgid may set msg.
-      octave_value val = mk_gr_map (octave_group::getgrgid (gid, msg));
-
-      retval = ovl (val, msg);
-    }
-
-  else
+  if (D_NINT (dval) != dval)
     error ("getgrgid: GID must be an integer");
 
-  return retval;
+  gid_t gid = static_cast<gid_t> (dval);
+
+  std::string msg;
+
+  // octave_group::getgrgid may set msg.
+  octave_value val = mk_gr_map (octave_group::getgrgid (gid, msg));
+
+  return ovl (val, msg);
 }
 
 DEFUN (getgrnam, args, ,
@@ -131,8 +120,6 @@
 @seealso{getgrgid}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -143,9 +130,7 @@
   // octave_group::getgrnam may set msg.
   octave_value val = mk_gr_map (octave_group::getgrnam (s.c_str (), msg));
 
-  retval = ovl (val, msg);
-
-  return retval;
+  return ovl (val, msg);
 }
 
 DEFUN (setgrent, args, ,
@@ -155,8 +140,6 @@
 @seealso{getgrent, endgrent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
@@ -165,9 +148,7 @@
   // octave_group::setgrent may set msg.
   int status = octave_group::setgrent (msg);
 
-  retval = ovl (static_cast<double> (status), msg);
-
-  return retval;
+  return ovl (static_cast<double> (status), msg);
 }
 
 DEFUN (endgrent, args, ,
@@ -177,8 +158,6 @@
 @seealso{getgrent, setgrent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
@@ -187,7 +166,5 @@
   // octave_group::endgrent may set msg.
   int status = octave_group::endgrent (msg);
 
-  retval = ovl (static_cast<double> (status), msg);
-
-  return retval;
+  return ovl (static_cast<double> (status), msg);
 }
--- a/libinterp/corefcn/getpwent.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/getpwent.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -75,8 +75,6 @@
 @seealso{setpwent, endpwent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
@@ -85,9 +83,7 @@
   // octave_passwd::getpwent may set msg.
   octave_value val = mk_pw_map (octave_passwd::getpwent (msg));
 
-  retval = ovl (val, msg);
-
-  return retval;
+  return ovl (val, msg);
 }
 
 DEFUN (getpwuid, args, ,
@@ -100,28 +96,22 @@
 @seealso{getpwnam}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
   double dval = args(0).double_value ();
 
-  if (D_NINT (dval) == dval)
-    {
-      uid_t uid = static_cast<uid_t> (dval);
-
-      std::string msg;
-
-      // octave_passwd::getpwuid may set msg.
-      octave_value val = mk_pw_map (octave_passwd::getpwuid (uid, msg));
-
-      retval = ovl (val, msg);
-    }
-  else
+  if (D_NINT (dval) != dval)
     error ("getpwuid: UID must be an integer");
 
-  return retval;
+  uid_t uid = static_cast<uid_t> (dval);
+
+  std::string msg;
+
+  // octave_passwd::getpwuid may set msg.
+  octave_value val = mk_pw_map (octave_passwd::getpwuid (uid, msg));
+
+  return ovl (val, msg);
 }
 
 DEFUN (getpwnam, args, ,
@@ -134,8 +124,6 @@
 @seealso{getpwuid}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -146,9 +134,7 @@
   // octave_passwd::getpwnam may set msg.
   octave_value val = mk_pw_map (octave_passwd::getpwnam (s, msg));
 
-  retval = ovl (val, msg);
-
-  return retval;
+  return ovl (val, msg);
 }
 
 DEFUN (setpwent, args, ,
@@ -158,8 +144,6 @@
 @seealso{getpwent, endpwent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
@@ -168,9 +152,7 @@
   // octave_passwd::setpwent may set msg.
   int status = octave_passwd::setpwent (msg);
 
-  retval = ovl (static_cast<double> (status), msg);
-
-  return retval;
+  return ovl (static_cast<double> (status), msg);
 }
 
 DEFUN (endpwent, args, ,
@@ -180,8 +162,6 @@
 @seealso{getpwent, setpwent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
@@ -190,7 +170,5 @@
   // octave_passwd::endpwent may set msg.
   int status = octave_passwd::endpwent (msg);
 
-  retval = ovl (static_cast<double> (status), msg);
-
-  return retval;
+  return ovl (static_cast<double> (status), msg);
 }
--- a/libinterp/corefcn/givens.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/givens.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -74,11 +74,11 @@
 @seealso{planerot}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 2)
     print_usage ();
 
+  octave_value_list retval;
+
   if (args(0).is_single_type () || args(1).is_single_type ())
     {
       if (args(0).is_complex_type () || args(1).is_complex_type ())
--- a/libinterp/corefcn/graphics.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/graphics.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -9588,7 +9588,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (is_handle (args(0)));
+  return ovl (is_handle (args(0)));
 }
 
 static bool
@@ -9634,7 +9634,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (is_handle_visible (args(0)));
+  return ovl (is_handle_visible (args(0)));
 }
 
 DEFUN (reset, args, ,
@@ -9857,13 +9857,13 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin == 0)
     print_usage ();
 
+  octave_value retval;
+
   // get vector of graphics handles
   ColumnVector hcv = args(0).xvector_value ("set: H must be a graphics handle");
 
@@ -9874,83 +9874,62 @@
     {
       graphics_object go = gh_manager::get_object (hcv(n));
 
-      if (go)
-        {
-          if (nargin == 3
-              && args(1).is_cellstr () && args(2).is_cell ())
-            {
-              if (args(2).cell_value ().rows () == 1)
-                {
-                  go.set (args(1).cellstr_value (),
-                          args(2).cell_value (), 0);
-                }
-              else if (hcv.numel () == args(2).cell_value ().rows ())
-                {
-                  go.set (args(1).cellstr_value (),
-                          args(2).cell_value (), n);
-                }
+      if (! go)
+        error ("set: invalid handle (= %g)", hcv(n));
+
+      if (nargin == 3 && args(1).is_cellstr () && args(2).is_cell ())
+        {
+          if (args(2).cell_value ().rows () == 1)
+            go.set (args(1).cellstr_value (), args(2).cell_value (), 0);
+          else if (hcv.numel () == args(2).cell_value ().rows ())
+            go.set (args(1).cellstr_value (), args(2).cell_value (), n);
+          else
+            error ("set: number of graphics handles must match number of value rows (%d != %d)",
+                   hcv.numel (), args(2).cell_value ().rows ());
+        }
+      else if (nargin == 2 && args(1).is_map ())
+        go.set (args(1).map_value ());
+      else if (nargin == 2 && args(1).is_string ())
+        {
+          std::string property = args(1).string_value ();
+
+          octave_map pmap = go.values_as_struct ();
+
+          if (go.has_readonly_property (property))
+            if (nargout != 0)
+              retval = Matrix ();
+            else
+              octave_stdout << "set: " << property
+                            <<" is read-only" << std::endl;
+          else if (pmap.isfield (property))
+            {
+              if (nargout != 0)
+                retval = pmap.getfield (property)(0);
               else
                 {
-                  error ("set: number of graphics handles must match number of value rows (%d != %d)",
-                         hcv.numel (), args(2).cell_value ().rows ());
-                  break;
-
-                }
-            }
-          else if (nargin == 2 && args(1).is_map ())
-            {
-              go.set (args(1).map_value ());
-            }
-          else if (nargin == 2 && args(1).is_string ())
-            {
-              std::string property = args(1).string_value ();
-
-              octave_map pmap = go.values_as_struct ();
-
-              if (go.has_readonly_property (property))
-                if (nargout != 0)
-                  retval = Matrix ();
-                else
-                  octave_stdout << "set: " << property
-                                <<" is read-only" << std::endl;
-              else if (pmap.isfield (property))
-                {
-                  if (nargout != 0)
-                    retval = pmap.getfield (property)(0);
-                  else
-                    {
-                      std::string s = go.value_as_string (property);
-
-                      octave_stdout << s;
-                    }
-                }
-              else
-                {
-                  error ("set: unknown property");
-                  break;
-                }
-            }
-          else if (nargin == 1)
-            {
-              if (nargout != 0)
-                retval = go.values_as_struct ();
-              else
-                {
-                  std::string s = go.values_as_string ();
+                  std::string s = go.value_as_string (property);
 
                   octave_stdout << s;
                 }
             }
           else
-            {
-              go.set (args.splice (0, 1));
-              request_drawnow = true;
+            error ("set: unknown property");
+        }
+      else if (nargin == 1)
+        {
+          if (nargout != 0)
+            retval = go.values_as_struct ();
+          else
+            {
+              std::string s = go.values_as_string ();
+
+              octave_stdout << s;
             }
         }
       else
         {
-          error ("set: invalid handle (= %g)", hcv(n));
-          break;
+          go.set (args.splice (0, 1));
+          request_drawnow = true;
         }
 
       request_drawnow = true;
@@ -9993,22 +9972,13 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
-  Cell vals;
-
   int nargin = args.length ();
 
-  bool use_cell_format = false;
-
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
   if (args(0).is_empty ())
-    {
-      retval = Matrix ();
-      return retval;
-    }
+    return ovl (Matrix ());
 
   ColumnVector hcv = args(0).xvector_value ("get: H must be a graphics handle");
 
@@ -10023,12 +9993,13 @@
           std::string typ = get_graphics_object_type (hcv(n));
 
           if (typ != typ0)
-            {
-              error ("get: vector of handles must all have the same type");
-              break;
-            }
-        }
-    }
+            error ("get: vector of handles must all have the same type");
+        }
+    }
+
+  octave_value retval;
+  Cell vals;
+  bool use_cell_format = false;
 
   if (nargin > 1 && args(1).is_cellstr ())
     {
@@ -10044,19 +10015,14 @@
         {
           graphics_object go = gh_manager::get_object (hcv(n));
 
-          if (go)
-            {
-              for (octave_idx_type m = 0; m < plen; m++)
-                {
-                  caseless_str property = plist(m);
-
-                  vals(n, m) = go.get (property);
-                }
-            }
-          else
-            {
-              error ("get: invalid handle (= %g)", hcv(n));
-              break;
+          if (! go)
+            error ("get: invalid handle (= %g)", hcv(n));
+
+          for (octave_idx_type m = 0; m < plen; m++)
+            {
+              caseless_str property = plist(m);
+
+              vals(n, m) = go.get (property);
             }
         }
     }
@@ -10073,18 +10039,13 @@
         {
           graphics_object go = gh_manager::get_object (hcv(n));
 
-          if (go)
-            {
-              if (nargin == 1)
-                vals(n) = go.get ();
-              else
-                vals(n) = go.get (property);
-            }
+          if (! go)
+            error ("get: invalid handle (= %g)", hcv(n));
+
+          if (nargin == 1)
+            vals(n) = go.get ();
           else
-            {
-              error ("get: invalid handle (= %g)", hcv(n));
-              break;
-            }
+            vals(n) = go.get (property);
         }
     }
 
@@ -10130,10 +10091,6 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
-  Cell vals;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -10141,7 +10098,9 @@
 
   octave_idx_type hcv_len = hcv.numel ();
 
-  vals.resize (dim_vector (hcv_len, 1));
+  Cell vals (dim_vector (hcv_len, 1));
+
+//  vals.resize (dim_vector (hcv_len, 1));
 
   for (octave_idx_type n = 0; n < hcv_len; n++)
     {
@@ -10150,20 +10109,17 @@
       if (go)
         vals(n) = go.get (true);
       else
-        {
-          error ("get: invalid handle (= %g)", hcv(n));
-          break;
-        }
+        error ("get: invalid handle (= %g)", hcv(n));
     }
 
   octave_idx_type vals_len = vals.numel ();
 
   if (vals_len > 1)
-    retval = vals;
+    return octave_value (vals);
   else if (vals_len == 1)
-    retval = vals(0);
-
-  return retval;
+    return octave_value (vals(0));
+  else
+    return octave_value_list ();
 }
 
 static octave_value
@@ -10241,13 +10197,13 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
   if (args.length () == 0)
     print_usage ();
 
   double val = args(0).xdouble_value ("__go_figure__: figure number must be a double value");
 
+  octave_value retval;
+
   if (is_figure (val))
     {
       graphics_handle h = gh_manager::lookup (val);
@@ -10295,7 +10251,6 @@
               // We need to initialize the integerhandle property
               // without calling the set_integerhandle method,
               // because doing that will generate a new handle value...
-
               graphics_object go = gh_manager::get_object (h);
               go.get_properties ().init_integerhandle ("off");
             }
@@ -10303,20 +10258,18 @@
       else if (val > 0 && D_NINT (val) == val)
         h = gh_manager::make_figure_handle (val, false);
 
-      if (h.ok ())
-        {
-          adopt (0, h);
-
-          gh_manager::push_figure (h);
-
-          xset (h, xargs);
-          xcreatefcn (h);
-          xinitialize (h);
-
-          retval = h.value ();
-        }
-      else
+      if (! h.ok ())
         error ("__go_figure__: failed to create figure handle");
+
+      adopt (0, h);
+
+      gh_manager::push_figure (h);
+
+      xset (h, xargs);
+      xcreatefcn (h);
+      xinitialize (h);
+
+      retval = h.value ();
     }
 
   return retval;
@@ -10516,8 +10469,6 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -10525,22 +10476,19 @@
 
   const NDArray vals = args(0).xarray_value ("delete: invalid graphics object");
 
-  // Check all the handles to delete are valid first, as callbacks
-  // might delete one of the handles we later want to delete
+  // Check all the handles to delete are valid first,
+  // as callbacks might delete one of the handles we later want to delete.
   for (octave_idx_type i = 0; i < vals.numel (); i++)
     {
       h = gh_manager::lookup (vals(i));
 
       if (! h.ok ())
-        {
-          error ("delete: invalid graphics object (= %g)", vals(i));
-          break;
-        }
+        error ("delete: invalid graphics object (= %g)", vals(i));
     }
 
   delete_graphics_objects (vals);
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (__go_axes_init__, args, ,
@@ -10551,39 +10499,33 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
   int nargin = args.length ();
 
-  std::string mode = "";
-
-  if (nargin == 2)
-    mode = args(1).string_value ();
-
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
+  std::string mode;
+  if (nargin == 2)
+    mode = args(1).string_value ();
+
   graphics_handle h = octave_NaN;
 
   double val = args(0).xdouble_value ("__go_axes_init__: invalid graphics object");
 
   h = gh_manager::lookup (val);
 
-  if (h.ok ())
-    {
-      graphics_object go = gh_manager::get_object (h);
-
-      go.set_defaults (mode);
-
-      h = gh_manager::lookup (val);
-      if (! h.ok ())
-        error ("__go_axes_init__: axis deleted during initialization (= %g)",
-               val);
-    }
-  else
+  if (! h.ok ())
     error ("__go_axes_init__: invalid graphics object (= %g)", val);
 
-  return retval;
+  graphics_object go = gh_manager::get_object (h);
+
+  go.set_defaults (mode);
+
+  h = gh_manager::lookup (val);
+  if (! h.ok ())
+    error ("__go_axes_init__: axis deleted during initialization (= %g)", val);
+
+  return octave_value_list ();
 }
 
 DEFUN (__go_handles__, args, ,
@@ -10625,8 +10567,6 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 2 || nargin > 3)
@@ -10636,19 +10576,17 @@
 
   graphics_handle h = gh_manager::lookup (val);
 
-  if (h.ok ())
-    {
-      std::string name = args(1).xstring_value ("__go_execute_callback__: invalid callback name");
-
-      if (nargin == 2)
-        gh_manager::execute_callback (h, name);
-      else
-        gh_manager::execute_callback (h, name, args(2));
-    }
-  else
+  if (! h.ok ())
     error ("__go_execute_callback__: invalid graphics object (= %g)", val);
 
-  return retval;
+  std::string name = args(1).xstring_value ("__go_execute_callback__: invalid callback name");
+
+  if (nargin == 2)
+    gh_manager::execute_callback (h, name);
+  else
+    gh_manager::execute_callback (h, name, args(2));
+
+  return octave_value_list ();
 }
 
 DEFUN (__image_pixel_size__, args, ,
@@ -10657,28 +10595,22 @@
 Internal function: returns the pixel size of the image in normalized units.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
   double h = args(0).xdouble_value ("__image_pixel_size__: argument is not a handle");
 
   graphics_object go = gh_manager::get_object (h);
-  if (go && go.isa ("image"))
-    {
-      image::properties& ip =
-        dynamic_cast<image::properties&> (go.get_properties ());
-
-      Matrix dp = Matrix (1, 2);
-      dp(0) = ip.pixel_xsize ();
-      dp(1) = ip.pixel_ysize ();
-      retval = dp;
-    }
-  else
+  if (! go || ! go.isa ("image"))
     error ("__image_pixel_size__: object is not an image");
 
-  return retval;
+  image::properties& ip =
+    dynamic_cast<image::properties&> (go.get_properties ());
+
+  Matrix dp = Matrix (1, 2);
+  dp(0) = ip.pixel_xsize ();
+  dp(1) = ip.pixel_ysize ();
+  return ovl (dp);
 }
 
 gtk_manager *gtk_manager::instance = 0;
@@ -10790,8 +10722,6 @@
 @seealso{available_graphics_toolkits}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   gh_manager::auto_lock guard;
 
   if (args.length () != 1)
@@ -10801,7 +10731,7 @@
 
   gtk_manager::register_toolkit (name);
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (loaded_graphics_toolkits, , ,
@@ -10835,8 +10765,6 @@
 {
   static int drawnow_executing = 0;
 
-  octave_value retval;
-
   if (args.length () > 4)
     print_usage ();
 
@@ -10893,7 +10821,7 @@
 
                   gh_manager::unlock ();
 
-                  return retval;
+                  return octave_value_list ();
                 }
             }
 
@@ -10925,7 +10853,7 @@
 
               gh_manager::unlock ();
 
-              return retval;
+              return octave_value_list ();
             }
           else if (pos_c == std::string::npos)
             {
@@ -10933,7 +10861,7 @@
 
               gh_manager::unlock ();
 
-              return retval;
+              return octave_value_list ();
             }
           else if (pos_p != std::string::npos && pos_p < pos_c)
             {
@@ -10957,7 +10885,7 @@
 
                       gh_manager::unlock ();
 
-                      return retval;
+                      return octave_value_list ();
                     }
                 }
             }
@@ -10994,7 +10922,7 @@
 
   gh_manager::unlock ();
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (addlistener, args, ,
@@ -11034,9 +10962,9 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
-  if (args.length () < 3 || args.length () > 4)
+  int nargin = args.length ();
+
+  if (nargin < 3 || nargin > 4)
     print_usage ();
 
   double h = args(0).xdouble_value ("addlistener: invalid handle H");
@@ -11045,23 +10973,21 @@
 
   graphics_handle gh = gh_manager::lookup (h);
 
-  if (gh.ok ())
-    {
-      graphics_object go = gh_manager::get_object (gh);
-
-      go.add_property_listener (pname, args(2), POSTSET);
-
-      if (args.length () == 4)
-        {
-          caseless_str persistent = args(3).string_value ();
-          if (persistent.compare ("persistent"))
-            go.add_property_listener (pname, args(2), PERSISTENT);
-        }
-    }
-  else
+  if (! gh.ok ())
     error ("addlistener: invalid graphics object (= %g)", h);
 
-  return retval;
+  graphics_object go = gh_manager::get_object (gh);
+
+  go.add_property_listener (pname, args(2), POSTSET);
+
+  if (args.length () == 4)
+    {
+      caseless_str persistent = args(3).string_value ();
+      if (persistent.compare ("persistent"))
+        go.add_property_listener (pname, args(2), PERSISTENT);
+    }
+
+  return octave_value_list ();
 }
 
 DEFUN (dellistener, args, ,
@@ -11094,8 +11020,6 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
-
   if (args.length () < 2 || args.length () > 3)
     print_usage ();
 
@@ -11105,30 +11029,28 @@
 
   graphics_handle gh = gh_manager::lookup (h);
 
-  if (gh.ok ())
-    {
-      graphics_object go = gh_manager::get_object (gh);
-
-      if (args.length () == 2)
-        go.delete_property_listener (pname, octave_value (), POSTSET);
+  if (! gh.ok ())
+    error ("dellistener: invalid graphics object (= %g)", h);
+
+  graphics_object go = gh_manager::get_object (gh);
+
+  if (args.length () == 2)
+    go.delete_property_listener (pname, octave_value (), POSTSET);
+  else
+    {
+      if (args(2).is_string ()
+          && args(2).string_value () == "persistent")
+        {
+          go.delete_property_listener (pname, octave_value (),
+                                       PERSISTENT);
+          go.delete_property_listener (pname, octave_value (),
+                                       POSTSET);
+        }
       else
-        {
-          if (args(2).is_string ()
-              && args(2).string_value () == "persistent")
-            {
-              go.delete_property_listener (pname, octave_value (),
-                                           PERSISTENT);
-              go.delete_property_listener (pname, octave_value (),
-                                           POSTSET);
-            }
-          else
-            go.delete_property_listener (pname, args(2), POSTSET);
-        }
-    }
-  else
-    error ("dellistener: invalid graphics object (= %g)", h);
-
-  return retval;
+        go.delete_property_listener (pname, args(2), POSTSET);
+    }
+
+  return octave_value_list ();
 }
 
 DEFUN (addproperty, args, ,
@@ -11216,27 +11138,22 @@
 
   graphics_handle gh = gh_manager::lookup (h);
 
-  if (gh.ok ())
-    {
-      graphics_object go = gh_manager::get_object (gh);
-
-      std::string type = args(2).xstring_value ("addproperty: TYPE must be a string");
-
-      if (! go.get_properties ().has_property (name))
-        {
-          property p = property::create (name, gh, type,
-                                         args.splice (0, 3));
-
-          go.get_properties ().insert_property (name, p);
-        }
-      else
-        error ("addproperty: a '%s' property already exists in the graphics object",
-               name.c_str ());
-    }
-  else
+  if (! gh.ok ())
     error ("addproperty: invalid graphics object (= %g)", h);
 
-  return retval;
+  graphics_object go = gh_manager::get_object (gh);
+
+  std::string type = args(2).xstring_value ("addproperty: TYPE must be a string");
+
+  if (go.get_properties ().has_property (name))
+    error ("addproperty: a '%s' property already exists in the graphics object",
+           name.c_str ());
+
+  property p = property::create (name, gh, type, args.splice (0, 3));
+
+  go.get_properties ().insert_property (name, p);
+
+  return octave_value_list ();
 }
 
 octave_value
@@ -11245,15 +11162,12 @@
 {
   gh_manager::auto_lock guard;
 
-  octave_value retval;
   graphics_object go = gh_manager::get_object (handle);
 
-  if (go)
-    retval = go.get (caseless_str (property));
-  else
+  if (! go)
     error ("%s: invalid handle (= %g)", func.c_str (), handle);
 
-  return retval;
+  return ovl (go.get (caseless_str (property)));
 }
 
 bool
@@ -11450,7 +11364,10 @@
     {
       pname = args(1).xstring_value ("waitfor: PROP must be a string");
 
-      if (! pname.empty () && ! pname.compare ("timeout"))
+      if (pname.empty ())
+        error ("waitfor: PROP must be a non-empty string");
+
+      if (pname != "timeout")
         {
           if (pname.compare ("\\timeout"))
             pname = "timeout";
@@ -11503,21 +11420,16 @@
               graphics_object go = gh_manager::get_object (gh);
 
               if (max_arg_index >= 2
-                  && compare_property_values (go.get (pname),
-                                              args(2)))
+                  && compare_property_values (go.get (pname), args(2)))
                 waitfor_results[id] = true;
               else
                 {
 
-                  frame.add_fcn (cleanup_waitfor_postset_listener,
-                                 ov_listener);
-                  go.add_property_listener (pname, ov_listener,
-                                            POSTSET);
-                  go.add_property_listener (pname, ov_listener,
-                                            PERSISTENT);
-
-                  if (go.get_properties ()
-                      .has_dynamic_property (pname))
+                  frame.add_fcn (cleanup_waitfor_postset_listener, ov_listener);
+                  go.add_property_listener (pname, ov_listener, POSTSET);
+                  go.add_property_listener (pname, ov_listener, PERSISTENT);
+
+                  if (go.get_properties ().has_dynamic_property (pname))
                     {
                       static octave_value wf_del_listener;
 
@@ -11544,8 +11456,6 @@
                 }
             }
         }
-      else if (pname.empty ())
-        error ("waitfor: PROP must be a non-empty string");
     }
 
   if (timeout_index < 0 && args.length () > (max_arg_index + 1))
@@ -11625,7 +11535,7 @@
         }
     }
 
-  return octave_value ();
+  return octave_value_list ();
 }
 
 DEFUN (__zoom__, args, ,
@@ -11636,8 +11546,6 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin != 2 && nargin != 3)
@@ -11681,6 +11589,6 @@
       Vdrawnow_requested = true;
     }
 
-  return retval;
-}
-
+  return octave_value_list ();
+}
+
--- a/libinterp/corefcn/help.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/help.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1089,21 +1089,16 @@
 @seealso{get_help_text_from_file}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
   const std::string name = args(0).xstring_value ("get_help_text: NAME must be a string");
 
-  std::string text;
-  std::string format;
+  std::string text, format;
 
   do_get_help_text (name, text, format);
 
-  retval = ovl (text, format);
-
-  return retval;
+  return ovl (text, format);
 }
 
 static void
@@ -1151,21 +1146,16 @@
 @seealso{get_help_text}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
   const std::string fname = args(0).xstring_value ("get_help_text_from_file: NAME must be a string");
 
-  std::string text;
-  std::string format;
+  std::string text, format;
 
   do_get_help_text_from_file (fname, text, format);
 
-  retval = ovl (text, format);
-
-  return retval;
+  return ovl (text, format);
 }
 
 // Return a cell array of strings containing the names of all
--- a/libinterp/corefcn/hess.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/hess.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -64,8 +64,6 @@
 @seealso{eig, chol, lu, qr, qz, schur, svd}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -77,16 +75,18 @@
   int arg_is_empty = empty_arg ("hess", nr, nc);
 
   if (arg_is_empty < 0)
-    return retval;
+    return octave_value_list ();
   else if (arg_is_empty > 0)
     return octave_value_list (2, Matrix ());
 
   if (nr != nc)
     {
       gripe_square_matrix_required ("hess");
-      return retval;
+      return octave_value_list ();
     }
 
+  octave_value_list retval;
+
   if (arg.is_single_type ())
     {
       if (arg.is_real_type ())
--- a/libinterp/corefcn/hex2num.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/hex2num.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -65,8 +65,6 @@
 @seealso{num2hex, hex2dec, dec2hex}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -74,109 +72,103 @@
 
   if (nargin == 2 && ! args(1).is_string ())
     error ("hex2num: CLASS must be a string");
+
+  const charMatrix cmat = args(0).char_matrix_value ();
+  std::string prec = (nargin == 2) ? args(1).string_value () : "double";
+  bool is_single = (prec == "single");
+  octave_idx_type nchars = (is_single) ? 8 : 16;
+
+  if (cmat.columns () > nchars)
+    error ("hex2num: S must be no more than %d characters", nchars);
+  else if (prec != "double" && prec != "single")
+    error ("hex2num: CLASS must be either \"double\" or \"single\"");
+
+  octave_value retval;
+  octave_idx_type nr = cmat.rows ();
+  octave_idx_type nc = cmat.columns ();
+
+  if (is_single)
+    {
+      FloatColumnVector m (nr);
+
+      for (octave_idx_type i = 0; i < nr; i++)
+        {
+          union
+          {
+            uint32_t ival;
+            float dval;
+          } num;
+
+          num.ival = 0;
+
+          for (octave_idx_type j = 0; j < nc; j++)
+            {
+              unsigned char ch = cmat.elem (i, j);
+
+              if (isxdigit (ch))
+                {
+                  num.ival <<= 4;
+                  if (ch >= 'a')
+                    num.ival += static_cast<uint32_t> (ch - 'a' + 10);
+                  else if (ch >= 'A')
+                    num.ival += static_cast<uint32_t> (ch - 'A' + 10);
+                  else
+                    num.ival += static_cast<uint32_t> (ch - '0');
+                }
+              else
+                {
+                  error ("hex2num: illegal character found in string S");
+                  break;
+                }
+            }
+
+          if (nc < nchars)
+            num.ival <<= (nchars - nc) * 4;
+
+          m(i) = num.dval;
+        }
+
+      retval =  m;
+    }
   else
     {
-      const charMatrix cmat = args(0).char_matrix_value ();
-      std::string prec = (nargin == 2) ? args(1).string_value () : "double";
-      bool is_single = (prec == "single");
-      octave_idx_type nchars = (is_single) ? 8 : 16;
-
-      if (cmat.columns () > nchars)
-        error ("hex2num: S must be no more than %d characters", nchars);
-      else if (prec != "double" && prec != "single")
-        error ("hex2num: CLASS must be either \"double\" or \"single\"");
-      else
-        {
-          octave_idx_type nr = cmat.rows ();
-          octave_idx_type nc = cmat.columns ();
-
-          if (is_single)
-            {
-              FloatColumnVector m (nr);
+      ColumnVector m (nr);
 
-              for (octave_idx_type i = 0; i < nr; i++)
-                {
-                  union
-                  {
-                    uint32_t ival;
-                    float dval;
-                  } num;
-
-                  num.ival = 0;
-
-                  for (octave_idx_type j = 0; j < nc; j++)
-                    {
-                      unsigned char ch = cmat.elem (i, j);
+      for (octave_idx_type i = 0; i < nr; i++)
+        {
+          union
+          {
+            uint64_t ival;
+            double dval;
+          } num;
 
-                      if (isxdigit (ch))
-                        {
-                          num.ival <<= 4;
-                          if (ch >= 'a')
-                            num.ival += static_cast<uint32_t> (ch - 'a' + 10);
-                          else if (ch >= 'A')
-                            num.ival += static_cast<uint32_t> (ch - 'A' + 10);
-                          else
-                            num.ival += static_cast<uint32_t> (ch - '0');
-                        }
-                      else
-                        {
-                          error ("hex2num: illegal character found in string S");
-                          break;
-                        }
-                    }
+          num.ival = 0;
+
+          for (octave_idx_type j = 0; j < nc; j++)
+            {
+              unsigned char ch = cmat.elem (i, j);
 
-                  if (nc < nchars)
-                    num.ival <<= (nchars - nc) * 4;
-
-                  m(i) = num.dval;
+              if (isxdigit (ch))
+                {
+                  num.ival <<= 4;
+                  if (ch >= 'a')
+                    num.ival += static_cast<uint64_t> (ch - 'a' + 10);
+                  else if (ch >= 'A')
+                    num.ival += static_cast<uint64_t> (ch - 'A' + 10);
+                  else
+                    num.ival += static_cast<uint64_t> (ch - '0');
                 }
-
-              retval =  m;
+              else
+                error ("hex2num: illegal character found in string S");
             }
-          else
-            {
-              ColumnVector m (nr);
-
-              for (octave_idx_type i = 0; i < nr; i++)
-                {
-                  union
-                  {
-                    uint64_t ival;
-                    double dval;
-                  } num;
-
-                  num.ival = 0;
-
-                  for (octave_idx_type j = 0; j < nc; j++)
-                    {
-                      unsigned char ch = cmat.elem (i, j);
 
-                      if (isxdigit (ch))
-                        {
-                          num.ival <<= 4;
-                          if (ch >= 'a')
-                            num.ival += static_cast<uint64_t> (ch - 'a' + 10);
-                          else if (ch >= 'A')
-                            num.ival += static_cast<uint64_t> (ch - 'A' + 10);
-                          else
-                            num.ival += static_cast<uint64_t> (ch - '0');
-                        }
-                      else
-                        {
-                          error ("hex2num: illegal character found in string S");
-                          break;
-                        }
-                    }
+          if (nc < nchars)
+            num.ival <<= (nchars - nc) * 4;
 
-                  if (nc < nchars)
-                    num.ival <<= (nchars - nc) * 4;
+          m(i) = num.dval;
+        }
 
-                  m(i) = num.dval;
-                }
-
-              retval =  m;
-            }
-        }
+      retval =  m;
     }
 
   return retval;
@@ -220,11 +212,11 @@
 @seealso{hex2num, hex2dec, dec2hex}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   if (args(0).is_single_type ())
     {
       const FloatColumnVector v (args(0).float_vector_value ());
--- a/libinterp/corefcn/input.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/input.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -913,8 +913,6 @@
 @seealso{dbstop, dbcont, dbquit}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () > 1)
     print_usage ();
 
@@ -933,7 +931,7 @@
 
   do_keyboard (args);
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (echo, args, ,
@@ -969,7 +967,7 @@
 {
   octave_value_list retval;
 
-  string_vector argv = args.make_argv ("echo");
+  string_vector argv = args.make_argv ("");
 
   switch (args.length ())
     {
@@ -985,7 +983,7 @@
 
     case 1:
       {
-        std::string arg = argv[1];
+        std::string arg = argv[0];
 
         if (arg == "on")
           Vecho_executing_commands = ECHO_SCRIPTS;
@@ -998,14 +996,14 @@
 
     case 2:
       {
-        std::string arg = argv[1];
+        std::string arg = argv[0];
 
-        if (arg == "on" && argv[2] == "all")
+        if (arg == "on" && argv[1] == "all")
           {
             int tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS);
             Vecho_executing_commands = tmp;
           }
-        else if (arg == "off" && argv[2] == "all")
+        else if (arg == "off" && argv[1] == "all")
           Vecho_executing_commands = ECHO_OFF;
         else
           print_usage ();
@@ -1017,7 +1015,7 @@
       break;
     }
 
-  return retval;
+  return octave_value_list ();
 }
 
 /*
@@ -1047,7 +1045,7 @@
 %!   echo_executing_commands (state);
 %! end_unwind_protect
 
-%!#test  # FIXME: Uncommend when ug #45209 is fixed
+%!#test  # FIXME: This passes, but produces a lot of onscreen output
 %! state = echo_executing_commands ();
 %! unwind_protect
 %!   echo ("on", "all");
@@ -1087,11 +1085,11 @@
 a feature, not a bug.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   std::string hint = args(0).string_value ();
 
   int n = 32;
@@ -1173,8 +1171,6 @@
 @seealso{readline_re_read_init_file}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
@@ -1189,7 +1185,7 @@
       command_editor::read_init_file (file);
     }
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (readline_re_read_init_file, args, ,
@@ -1202,14 +1198,12 @@
 @seealso{readline_read_init_file}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
   command_editor::re_read_init_file ();
 
-  return retval;
+  return octave_value_list ();
 }
 
 static int
@@ -1273,8 +1267,6 @@
 @seealso{add_input_event_hook}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -1296,7 +1288,7 @@
   if (input_event_hook_functions.empty ())
     command_editor::remove_event_hook (internal_input_event_hook_fcn);
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (PS1, args, nargout,
@@ -1442,8 +1434,6 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
@@ -1454,7 +1444,7 @@
   else
     Vdrawnow_requested = args(0).bool_value ();
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (__gud_mode__, args, ,
@@ -1463,19 +1453,19 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value_list retval;
+
   if (nargin == 0)
-    retval = Vgud_mode;
+    retval = ovl (Vgud_mode);
   else
     Vgud_mode = args(0).bool_value ();
 
-  return retval;
+  return retval; 
 }
 
 DEFUN (filemarker, args, nargout,
--- a/libinterp/corefcn/kron.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/kron.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -264,13 +264,13 @@
 Since the Kronecker product is associative, this is well-defined.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 2)
     print_usage ();
 
+  octave_value retval;
+
   octave_value a = args(0);
   octave_value b = args(1);
 
--- a/libinterp/corefcn/load-path.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/load-path.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -2241,13 +2241,13 @@
 directories with those names.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin == 0)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 1)
     {
       std::string dirname = args(0).xstring_value ("genpath: DIR must be a string");
@@ -2406,19 +2406,19 @@
 @seealso{path, rmpath, genpath, pathdef, savepath, pathsep}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   // Originally written by Bill Denney and Etienne Grossman.  Heavily
   // modified and translated to C++ by jwe.
 
-  if (nargout > 0)
-    retval = load_path::path ();
-
   int nargin = args.length ();
 
   if (nargin == 0)
     print_usage ();
 
+  octave_value retval;
+
+  if (nargout > 0)
+    retval = load_path::path ();
+
   bool append = false;
 
   octave_value option_arg = args(nargin-1);
@@ -2502,16 +2502,16 @@
   // Originally written by Etienne Grossmann.  Heavily modified and translated
   // to C++ by jwe.
 
+  int nargin = args.length ();
+
+  if (nargin == 0)
+    print_usage ();
+
   octave_value retval;
 
   if (nargout > 0)
     retval = load_path::path ();
 
-  int nargin = args.length ();
-
-  if (nargin == 0)
-    print_usage ();
-
   bool need_to_update = false;
 
   for (int i = 0; i < nargin; i++)
--- a/libinterp/corefcn/load-save.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/load-save.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1582,19 +1582,11 @@
 @seealso{load, save_default_options, save_header_format_string, dlmread, csvread, fread}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
-  string_vector argv = args.make_argv ();
-
   // Here is where we would get the default save format if it were
   // stored in a user preference variable.
-
+  load_save_format format = LS_TEXT;
   bool save_as_floats = false;
-
-  load_save_format format = LS_TEXT;
-
   bool append = false;
-
   bool use_zlib = false;
 
   // get default options
@@ -1602,8 +1594,11 @@
                       use_zlib);
 
   // override from command line
+  string_vector argv = args.make_argv ();
+
   argv = parse_save_options (argv, format, append, save_as_floats,
                              use_zlib);
+
   int argc = argv.numel ();
   int i = 0;
 
@@ -1613,6 +1608,8 @@
   if (save_as_floats && format == LS_TEXT)
     error ("save: cannot specify both -text and -float-binary");
 
+  octave_value_list retval;
+
   if (argv[i] == "-")
     {
       i++;
--- a/libinterp/corefcn/lookup.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/lookup.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -238,11 +238,9 @@
 @end table\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
-  if (nargin < 2 || nargin > 3 || (nargin == 3 && ! args(2).is_string ()))
+  if (nargin < 2 || nargin > 3)
     print_usage ();
 
   octave_value table = args(0);
@@ -250,6 +248,8 @@
   if (table.ndims () > 2 || (table.columns () > 1 && table.rows () > 1))
     warning ("lookup: table is not a vector");
 
+  octave_value retval;
+
   bool num_case = ((table.is_numeric_type () && y.is_numeric_type ())
                    || (table.is_char_matrix () && y.is_char_matrix ()));
   bool str_case = table.is_cellstr () && (y.is_string () || y.is_cellstr ());
@@ -260,17 +260,14 @@
 
   if (nargin == 3)
     {
-      std::string opt = args(2).string_value ();
+      std::string opt = args(2).xstring_value ("lookup: OPT must be a string");
       left_inf = contains_char (opt, 'l');
       right_inf = contains_char (opt, 'r');
       match_idx = contains_char (opt, 'm');
       match_bool = contains_char (opt, 'b');
       if (opt.find_first_not_of ("lrmb") != std::string::npos)
-        {
-          error ("lookup: unrecognized option: %c",
-                 opt[opt.find_first_not_of ("lrmb")]);
-          return retval;
-        }
+        error ("lookup: unrecognized option: %c",
+               opt[opt.find_first_not_of ("lrmb")]);
     }
 
   if ((match_idx || match_bool) && (left_inf || right_inf))
@@ -284,7 +281,6 @@
     {
       // In the case of a complex array, absolute values will be used for
       // compatibility (though it's not too meaningful).
-
       if (table.is_complex_type ())
         table = table.abs ();
 
@@ -365,7 +361,6 @@
     print_usage ();
 
   return retval;
-
 }
 
 /*
--- a/libinterp/corefcn/mappers.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/mappers.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -63,7 +63,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).abs ());
+  return ovl (args(0).abs ());
 }
 
 /*
@@ -93,7 +93,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).acos ());
+  return ovl (args(0).acos ());
 }
 
 /*
@@ -139,7 +139,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).acosh ());
+  return ovl (args(0).acosh ());
 }
 
 /*
@@ -178,7 +178,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).arg ());
+  return ovl (args(0).arg ());
 }
 
 DEFUN (arg, args, ,
@@ -210,7 +210,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).arg ());
+  return ovl (args(0).arg ());
 }
 
 /*
@@ -246,7 +246,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).asin ());
+  return ovl (args(0).asin ());
 }
 
 /*
@@ -291,7 +291,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).asinh ());
+  return ovl (args(0).asinh ());
 }
 
 /*
@@ -319,7 +319,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).atan ());
+  return ovl (args(0).atan ());
 }
 
 /*
@@ -351,7 +351,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).atanh ());
+  return ovl (args(0).atanh ());
 }
 
 /*
@@ -382,7 +382,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).cbrt ());
+  return ovl (args(0).cbrt ());
 }
 
 /*
@@ -421,7 +421,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).ceil ());
+  return ovl (args(0).ceil ());
 }
 
 /*
@@ -459,7 +459,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).conj ());
+  return ovl (args(0).conj ());
 }
 
 /*
@@ -489,7 +489,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).cos ());
+  return ovl (args(0).cos ());
 }
 
 /*
@@ -523,7 +523,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).cosh ());
+  return ovl (args(0).cosh ());
 }
 
 /*
@@ -571,7 +571,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).erf ());
+  return ovl (args(0).erf ());
 }
 
 /*
@@ -626,7 +626,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).erfinv ());
+  return ovl (args(0).erfinv ());
 }
 
 /*
@@ -663,7 +663,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).erfcinv ());
+  return ovl (args(0).erfcinv ());
 }
 
 /*
@@ -702,7 +702,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).erfc ());
+  return ovl (args(0).erfc ());
 }
 
 /*
@@ -738,7 +738,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).erfcx ());
+  return ovl (args(0).erfcx ());
 }
 
 /*
@@ -780,7 +780,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).erfi ());
+  return ovl (args(0).erfi ());
 }
 
 /*
@@ -817,7 +817,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).dawson ());
+  return ovl (args(0).dawson ());
 }
 
 /*
@@ -851,7 +851,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).exp ());
+  return ovl (args(0).exp ());
 }
 
 /*
@@ -884,7 +884,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).expm1 ());
+  return ovl (args(0).expm1 ());
 }
 
 /*
@@ -917,7 +917,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).finite ());
+  return ovl (args(0).finite ());
 }
 
 /*
@@ -953,7 +953,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).fix ());
+  return ovl (args(0).fix ());
 }
 
 /*
@@ -986,7 +986,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).floor ());
+  return ovl (args(0).floor ());
 }
 
 /*
@@ -1035,7 +1035,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).gamma ());
+  return ovl (args(0).gamma ());
 }
 
 /*
@@ -1078,7 +1078,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).imag ());
+  return ovl (args(0).imag ());
 }
 
 /*
@@ -1109,7 +1109,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisalnum ());
+  return ovl (args(0).xisalnum ());
 }
 
 /*
@@ -1138,7 +1138,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisalpha ());
+  return ovl (args(0).xisalpha ());
 }
 
 /*
@@ -1164,7 +1164,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisascii ());
+  return ovl (args(0).xisascii ());
 }
 
 /*
@@ -1188,7 +1188,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xiscntrl ());
+  return ovl (args(0).xiscntrl ());
 }
 
 /*
@@ -1214,7 +1214,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisdigit ());
+  return ovl (args(0).xisdigit ());
 }
 
 /*
@@ -1248,7 +1248,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).isinf ());
+  return ovl (args(0).isinf ());
 }
 
 /*
@@ -1280,7 +1280,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisgraph ());
+  return ovl (args(0).xisgraph ());
 }
 
 /*
@@ -1305,7 +1305,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xislower ());
+  return ovl (args(0).xislower ());
 }
 
 /*
@@ -1339,7 +1339,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).isna ());
+  return ovl (args(0).isna ());
 }
 
 /*
@@ -1379,7 +1379,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).isnan ());
+  return ovl (args(0).isnan ());
 }
 
 /*
@@ -1411,7 +1411,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisprint ());
+  return ovl (args(0).xisprint ());
 }
 
 /*
@@ -1436,7 +1436,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xispunct ());
+  return ovl (args(0).xispunct ());
 }
 
 /*
@@ -1465,7 +1465,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisspace ());
+  return ovl (args(0).xisspace ());
 }
 
 /*
@@ -1490,7 +1490,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisupper ());
+  return ovl (args(0).xisupper ());
 }
 
 /*
@@ -1515,7 +1515,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xisxdigit ());
+  return ovl (args(0).xisxdigit ());
 }
 
 /*
@@ -1542,7 +1542,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).lgamma ());
+  return ovl (args(0).lgamma ());
 }
 
 /*
@@ -1593,7 +1593,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).log ());
+  return ovl (args(0).log ());
 }
 
 /*
@@ -1617,7 +1617,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).log10 ());
+  return ovl (args(0).log10 ());
 }
 
 /*
@@ -1645,7 +1645,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).log1p ());
+  return ovl (args(0).log1p ());
 }
 
 /*
@@ -1666,7 +1666,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).real ());
+  return ovl (args(0).real ());
 }
 
 /*
@@ -1705,7 +1705,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).round ());
+  return ovl (args(0).round ());
 }
 
 /*
@@ -1743,7 +1743,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).roundb ());
+  return ovl (args(0).roundb ());
 }
 
 /*
@@ -1803,7 +1803,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).signum ());
+  return ovl (args(0).signum ());
 }
 
 /*
@@ -1842,7 +1842,7 @@
 
   octave_value tmp = args(0).xsignbit ();
 
-  return octave_value (tmp != 0);
+  return ovl (tmp != 0);
 }
 
 /*
@@ -1870,7 +1870,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).sin ());
+  return ovl (args(0).sin ());
 }
 
 /*
@@ -1902,7 +1902,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).sinh ());
+  return ovl (args(0).sinh ());
 }
 
 /*
@@ -1934,7 +1934,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).sqrt ());
+  return ovl (args(0).sqrt ());
 }
 
 /*
@@ -1962,7 +1962,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).tan ());
+  return ovl (args(0).tan ());
 }
 
 /*
@@ -1994,7 +1994,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).tanh ());
+  return ovl (args(0).tanh ());
 }
 
 /*
@@ -2032,7 +2032,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xtoascii ());
+  return ovl (args(0).xtoascii ());
 }
 
 /*
@@ -2069,7 +2069,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xtolower ());
+  return ovl (args(0).xtolower ());
 }
 
 DEFALIAS (lower, tolower);
@@ -2128,7 +2128,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).xtoupper ());
+  return ovl (args(0).xtoupper ());
 }
 
 DEFALIAS (upper, toupper);
--- a/libinterp/corefcn/matrix_type.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/matrix_type.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -119,7 +119,6 @@
 @code{matrix_type} will return the correct classification of the matrix.\n\
 @end deftypefn")
 {
-  octave_value retval;
   int nargin = args.length ();
 
   if (nargin == 0 || nargin > 4)
@@ -133,6 +132,8 @@
       autocomp = false;
     }
 
+  octave_value retval;
+
   if (args(0).is_scalar_type ())
     {
       if (nargin == 1)
@@ -211,7 +212,6 @@
       else
         {
           // Ok, we're changing the matrix type
-
           std::string str_typ = args(1).xstring_value ("matrix_type: TYPE must be a string");
 
           // FIXME: why do I have to explicitly call the constructor?
@@ -237,19 +237,17 @@
             {
               if (nargin != 4)
                 error ("matrix_type: banded matrix type requires 4 arguments");
-              else
-                {
-                  nl = args(2).xnint_value ("matrix_type: band size NL, NU must be integers");
-                  nu = args(3).xnint_value ("matrix_type: band size NL, NU must be integers");
+
+              nl = args(2).xnint_value ("matrix_type: band size NL, NU must be integers");
+              nu = args(3).xnint_value ("matrix_type: band size NL, NU must be integers");
 
-                  if (nl == 1 && nu == 1)
-                    mattyp.mark_as_tridiagonal ();
-                  else
-                    mattyp.mark_as_banded (nu, nl);
+              if (nl == 1 && nu == 1)
+                mattyp.mark_as_tridiagonal ();
+              else
+                mattyp.mark_as_banded (nu, nl);
 
-                  if (str_typ == "banded positive definite")
-                    mattyp.mark_as_symmetric ();
-                }
+              if (str_typ == "banded positive definite")
+                mattyp.mark_as_symmetric ();
             }
           else if (str_typ == "positive definite")
             {
@@ -275,15 +273,13 @@
 
               if (len != dv(0))
                 error ("matrix_type: Invalid permutation vector PERM");
-              else
-                {
-                  OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len);
+
+              OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len);
 
-                  for (octave_idx_type i = 0; i < len; i++)
-                    p[i] = static_cast<octave_idx_type> (perm (i)) - 1;
+              for (octave_idx_type i = 0; i < len; i++)
+                p[i] = static_cast<octave_idx_type> (perm (i)) - 1;
 
-                  mattyp.mark_as_permuted (len, p);
-                }
+              mattyp.mark_as_permuted (len, p);
             }
           else if (nargin != 2
                    && str_typ != "banded positive definite"
@@ -378,7 +374,6 @@
       else
         {
           // Ok, we're changing the matrix type
-
           std::string str_typ = args(1).xstring_value ("matrix_type: TYPE must be a string");
 
           // FIXME: why do I have to explicitly call the constructor?
@@ -415,15 +410,13 @@
 
               if (len != dv(0))
                 error ("matrix_type: Invalid permutation vector PERM");
-              else
-                {
-                  OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len);
+
+              OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len);
 
-                  for (octave_idx_type i = 0; i < len; i++)
-                    p[i] = static_cast<octave_idx_type> (perm (i)) - 1;
+              for (octave_idx_type i = 0; i < len; i++)
+                p[i] = static_cast<octave_idx_type> (perm (i)) - 1;
 
-                  mattyp.mark_as_permuted (len, p);
-                }
+              mattyp.mark_as_permuted (len, p);
             }
           else if (nargin != 2)
             error ("matrix_type: Invalid number of arguments");
--- a/libinterp/corefcn/mgorth.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/mgorth.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -67,8 +67,6 @@
 \n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -77,16 +75,13 @@
 
   if (arg_v.ndims () != 2 || arg_x.ndims () != 2 || arg_x.columns () != 1
       || arg_v.rows () != arg_x.rows ())
-    {
-      error ("mgorth: V should be a matrix, and X a column vector with"
-             " the same number of rows as V.");
-      return retval;
-    }
+    error ("mgorth: V should be a matrix, and X a column vector with"
+           " the same number of rows as V.");
 
   if (! arg_x.is_numeric_type () && ! arg_v.is_numeric_type ())
-    {
-      error ("mgorth: X and V must be numeric");
-    }
+    error ("mgorth: X and V must be numeric");
+
+  octave_value_list retval;
 
   bool iscomplex = (arg_x.is_complex_type () || arg_v.is_complex_type ());
   if (arg_x.is_single_type () || arg_v.is_single_type ())
--- a/libinterp/corefcn/nproc.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/nproc.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -49,8 +49,6 @@
 @end table\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
@@ -73,9 +71,7 @@
         error ("nproc: invalid value for QUERY");
     }
 
-  retval = num_processors (query);
-
-  return retval;
+  return ovl (num_processors (query));
 }
 
 /*
--- a/libinterp/corefcn/ordschur.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/ordschur.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -107,8 +107,6 @@
 @seealso{schur}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 3)
     print_usage ();
 
@@ -118,11 +116,14 @@
 
   const dim_vector dimU = args(0).dims ();
   const dim_vector dimS = args(1).dims ();
+
   if (n != dimU(0))
     error ("ordschur: SELECT must have same length as the sides of U and S");
   else if (n != dimU(0) || n != dimS(0) || n != dimU(1) || n != dimS(1))
     error ("ordschur: U and S must be square and of equal sizes");
 
+  octave_value_list retval;
+
   const bool double_type  = args(0).is_double_type ()
                             || args(1).is_double_type ();
   const bool complex_type = args(0).is_complex_type ()
@@ -154,6 +155,7 @@
                      sel.data (), n, S.fortran_vec (), n, U.fortran_vec (), n,
                      w.fortran_vec (), m, cond1, cond2, work.fortran_vec (), n,
                      info));
+
           PREPARE_OUTPUT()
         }
       else
@@ -167,6 +169,7 @@
                      sel.data (), n, S.fortran_vec (), n, U.fortran_vec (), n,
                      w.fortran_vec (), wi.fortran_vec (), m, cond1, cond2,
                      work.fortran_vec (), n, iwork.fortran_vec (), n, info));
+
           PREPARE_OUTPUT ()
         }
     }
@@ -181,6 +184,7 @@
                      sel.data (), n, S.fortran_vec (), n, U.fortran_vec (), n,
                      w.fortran_vec (), m, cond1, cond2, work.fortran_vec (), n,
                      info));
+
           PREPARE_OUTPUT ()
         }
       else
@@ -194,6 +198,7 @@
                      sel.data (), n, S.fortran_vec (), n, U.fortran_vec (), n,
                      w.fortran_vec (), wi.fortran_vec (), m, cond1, cond2,
                      work.fortran_vec (), n, iwork.fortran_vec (), n, info));
+
           PREPARE_OUTPUT ()
         }
     }
--- a/libinterp/corefcn/pager.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/pager.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -574,7 +574,7 @@
         }
     }
 
-  return octave_value ();
+  return octave_value_list ();
 }
 
 DEFUN (__diaryfile__, , ,
--- a/libinterp/corefcn/pinv.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/pinv.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -54,8 +54,6 @@
 where @code{sigma_max (@var{x})} is the maximal singular value of @var{x}.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -66,10 +64,12 @@
   int arg_is_empty = empty_arg ("pinv", arg.rows (), arg.columns ());
 
   if (arg_is_empty < 0)
-    return retval;
+    return octave_value_list ();
   else if (arg_is_empty > 0)
     return octave_value (Matrix ());
 
+  octave_value retval;
+
   bool isfloat = arg.is_single_type ();
 
   if (arg.is_diag_matrix ())
--- a/libinterp/corefcn/pr-output.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/pr-output.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -3426,61 +3426,54 @@
 @seealso{format, rat}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
+  octave_value arg = args(0);
+
+  if (! arg.is_numeric_type ())
+    error ("rats: X must be numeric");
+
   unwind_protect frame;
 
   frame.protect_var (rat_string_len);
 
   rat_string_len = 9;
-
   if (nargin == 2)
     rat_string_len = args(1).nint_value ();
 
-  octave_value arg = args(0);
-
-  if (arg.is_numeric_type ())
+  frame.protect_var (rat_format);
+
+  rat_format = true;
+
+  std::ostringstream buf;
+  arg.print (buf);
+  std::string s = buf.str ();
+
+  std::list<std::string> lst;
+
+  size_t n = 0;
+  size_t s_len = s.length ();
+
+  while (n < s_len)
     {
-      frame.protect_var (rat_format);
-
-      rat_format = true;
-
-      std::ostringstream buf;
-      arg.print (buf);
-      std::string s = buf.str ();
-
-      std::list<std::string> lst;
-
-      size_t n = 0;
-      size_t s_len = s.length ();
-
-      while (n < s_len)
+      size_t m = s.find ('\n',  n);
+
+      if (m == std::string::npos)
         {
-          size_t m = s.find ('\n',  n);
-
-          if (m == std::string::npos)
-            {
-              lst.push_back (s.substr (n));
-              break;
-            }
-          else
-            {
-              lst.push_back (s.substr (n, m - n));
-              n = m + 1;
-            }
+          lst.push_back (s.substr (n));
+          break;
         }
-
-      retval = string_vector (lst);
+      else
+        {
+          lst.push_back (s.substr (n, m - n));
+          n = m + 1;
+        }
     }
-  else
-    error ("rats: X must be numeric");
-
-  return retval;
+
+  return ovl (string_vector (lst));
 }
 
 DEFUN (disp, args, nargout,
@@ -3507,11 +3500,11 @@
 @seealso{fdisp}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value_list retval;
+
   octave_value arg = args(0);
 
   if (nargout == 0)
@@ -3547,8 +3540,6 @@
 @seealso{disp}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -3565,7 +3556,7 @@
   else
     error ("fdisp: stream FID not open for writing");
 
-  return retval;
+  return octave_value_list ();
 }
 
 /*
--- a/libinterp/corefcn/profiler.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/profiler.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -406,7 +406,7 @@
   if (nargin > 0)
     profiler.set_active (args(0).bool_value ());
 
-  return octave_value (profiler.is_active ());
+  return ovl (profiler.is_active ());
 }
 
 // Clear all collected profiling data.
@@ -416,14 +416,12 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () > 0)
     warning ("profiler_reset: ignoring extra arguments");
 
   profiler.reset ();
 
-  return retval;
+  return octave_value_list ();
 }
 
 // Query the timings collected by the profiler.
--- a/libinterp/corefcn/psi.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/psi.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -65,9 +65,8 @@
 @seealso{gamma, gammainc, gammaln}\n\
 @end deftypefn")
 {
-  octave_value retval;
+  int nargin = args.length ();
 
-  const octave_idx_type nargin = args.length ();
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
@@ -75,7 +74,10 @@
   const octave_idx_type k = (nargin == 1) ? 0 : args(0).idx_type_value ("psi: K must be an integer");
   if (k < 0)
     error ("psi: K must be non-negative");
-  else if (k == 0)
+
+  octave_value retval;
+
+  if (k == 0)
     {
 #define FLOAT_BRANCH(T, A, M, E) \
       if (oct_z.is_ ## T ##_type ()) \
--- a/libinterp/corefcn/quad.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/quad.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -180,9 +180,10 @@
 @seealso{quad_options, quadv, quadl, quadgk, quadcc, trapz, dblquad, triplequad}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
+  int nargin = args.length ();
 
-  std::string fcn_name;
+  if (nargin < 3 || nargin > 5)
+    print_usage ();
 
   warned_imaginary = false;
 
@@ -194,10 +195,7 @@
   if (call_depth > 1)
     error ("quad: invalid recursive call");
 
-  int nargin = args.length ();
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
+  std::string fcn_name;
 
   if (args(0).is_function_handle () || args(0).is_inline_function ())
     quad_fcn = args(0).function_value ();
@@ -215,6 +213,8 @@
   if (! quad_fcn)
     error ("quad: FCN argument is not a valid function name or handle");
 
+  octave_value_list retval;
+
   if (args(1).is_single_type () || args(2).is_single_type ())
     {
       float a = args(1).xfloat_value ("quad: lower limit of integration A must be a scalar");
--- a/libinterp/corefcn/rcond.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/rcond.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -45,14 +45,15 @@
 @seealso{cond, condest}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   if (args(0).is_sparse_type ())
     error ("rcond: for sparse matrices use 'rcond (full (a))' or 'condest (a)' instead");
-  else if (args(0).is_single_type ())
+
+  if (args(0).is_single_type ())
     {
       if (args(0).is_complex_type ())
         {
--- a/libinterp/corefcn/regexp.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/regexp.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1150,14 +1150,10 @@
   if (args.length () < 2)
     print_usage ();
 
-  octave_value_list retval;
-
   if (args(0).is_cell () || args(1).is_cell ())
-    retval = octcellregexp (args, (nargout > 0 ? nargout : 1), "regexpi", true);
+    return octcellregexp (args, (nargout > 0 ? nargout : 1), "regexpi", true);
   else
-    retval = octregexp (args, nargout, "regexpi", true);
-
-  return retval;
+    return octregexp (args, nargout, "regexpi", true);
 }
 
 /*
@@ -1439,8 +1435,8 @@
           ret(i) = new_args(0);
         }
 
-      retval = args(0).is_cell () ? octave_value (ret)
-                                  : octave_value (ret(0));
+      retval = args(0).is_cell () ? ovl (ret)
+                                  : ovl (ret(0));
     }
   else
     retval = octregexprep (args, "regexprep");
--- a/libinterp/corefcn/schur.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/schur.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -172,7 +172,7 @@
       return octave_value_list ();
     }
 
-  octave_value_list retval (nargout > 1 ? 2 : 1);
+  octave_value_list retval;
 
   if (! arg.is_numeric_type ())
     gripe_wrong_type_arg ("schur", arg);
--- a/libinterp/corefcn/sighandlers.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/sighandlers.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1057,7 +1057,7 @@
 
   static octave_scalar_map m = make_sig_struct ();
 
-  return octave_value (m);
+  return ovl (m);
 }
 
 /*
--- a/libinterp/corefcn/sparse.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/sparse.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -51,7 +51,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_sparse_type ());
+  return ovl (args(0).is_sparse_type ());
 }
 
 DEFUN (sparse, args, ,
@@ -122,12 +122,13 @@
 @seealso{full, accumarray, spalloc, spdiags, speye, spones, sprand, sprandn, sprandsym, spconvert, spfun}\n\
 @end deftypefn")
 {
-  octave_value retval;
   int nargin = args.length ();
 
   if (nargin == 0 || nargin > 6)
     print_usage ();
 
+  octave_value retval;
+
   // Temporarily disable sparse_auto_mutate if set (it's obsolete anyway).
   unwind_protect frame;
   frame.protect_var (Vsparse_auto_mutate);
@@ -257,8 +258,6 @@
 @seealso{nzmax, sparse}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 2 || nargin > 3)
@@ -266,15 +265,13 @@
 
   octave_idx_type m = args(0).idx_type_value ();
   octave_idx_type n = args(1).idx_type_value ();
+
   octave_idx_type nz = 0;
-
   if (nargin == 3)
     nz = args(2).idx_type_value ();
 
   if (m >= 0 && n >= 0 && nz >= 0)
-    retval = SparseMatrix (dim_vector (m, n), nz);
+    return ovl (SparseMatrix (dim_vector (m, n), nz));
   else
     error ("spalloc: M,N,NZ must be non-negative");
-
-  return retval;
 }
--- a/libinterp/corefcn/str2double.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/str2double.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -341,21 +341,17 @@
 @seealso{str2num}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   if (args(0).is_string ())
     {
       if (args(0).rows () == 0 || args(0).columns () == 0)
-        {
-          retval = Matrix (1, 1, octave_NaN);
-        }
+        retval = Matrix (1, 1, octave_NaN);
       else if (args(0).rows () == 1 && args(0).ndims () == 2)
-        {
-          retval = str2double1 (args(0).string_value ());
-        }
+        retval = str2double1 (args(0).string_value ());
       else
         {
           const string_vector sv = args(0).all_strings ();
@@ -368,6 +364,7 @@
       const Cell cell = args(0).cell_value ();
 
       ComplexNDArray output (cell.dims (), octave_NaN);
+
       for (octave_idx_type i = 0; i < cell.numel (); i++)
         {
           if (cell(i).is_string ())
--- a/libinterp/corefcn/strfind.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/strfind.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -192,30 +192,27 @@
 @seealso{findstr, strmatch, regexp, regexpi, find}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin != 4 && nargin != 2)
     print_usage ();
 
   bool overlaps = true;
-
   if (nargin == 4)
     {
-      if (args(2).is_string () && args(3).is_scalar_type ())
-        {
-          std::string opt = args(2).string_value ();
+      if (! args(2).is_string () || ! args(3).is_scalar_type ())
+        error ("strfind: invalid optional arguments");
+
+      std::string opt = args(2).string_value ();
 
-          if (opt == "overlaps")
-            overlaps = args(3).bool_value ();
-          else
-            error ("strfind: unknown option: %s", opt.c_str ());
-        }
+      if (opt == "overlaps")
+        overlaps = args(3).bool_value ();
       else
-        error ("strfind: invalid optional arguments");
+        error ("strfind: unknown option: %s", opt.c_str ());
     }
 
+  octave_value retval;
+
   octave_value argstr = args(0);
   octave_value argpat = args(1);
 
@@ -243,18 +240,16 @@
           for (octave_idx_type i = 0; i < ns; i++)
             {
               octave_value argse = argsc(i);
-              if (argse.is_string ())
-                {
-                  if (argpat.is_empty ())
-                    retc(i) = Matrix ();
-                  else
-                    retc(i) = octave_value (qs_search (needle,
-                                                       argse.char_array_value (),
-                                                       table, overlaps),
-                                            true, true);
-                }
+              if (! argse.is_string ())
+                error ("strfind: each element of CELLSTR must be a string");
+
+              if (argpat.is_empty ())
+                retc(i) = Matrix ();
               else
-                error ("strfind: each element of CELLSTR must be a string");
+                retc(i) = octave_value (qs_search (needle,
+                                                   argse.char_array_value (),
+                                                   table, overlaps),
+                                        true, true);
             }
 
           retval = retc;
@@ -383,29 +378,27 @@
 @seealso{regexprep, strfind, findstr}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-  bool overlaps = true;
-
   int nargin = args.length ();
 
   if (nargin != 3 && nargin != 5)
     print_usage ();
 
+  bool overlaps = true;
+
   if (nargin == 5)
     {
-      if (args(3).is_string () && args(4).is_scalar_type ())
-        {
-          std::string opt = args(3).string_value ();
-          if (opt == "overlaps")
-            overlaps = args(4).bool_value ();
-          else
-            error ("strrep: unknown option: %s", opt.c_str ());
-        }
+      if (! args(3).is_string () || ! args(4).is_scalar_type ())
+        error ("strrep: invalid optional arguments");
+
+      std::string opt = args(3).string_value ();
+      if (opt == "overlaps")
+        overlaps = args(4).bool_value ();
       else
-        error ("strrep: invalid optional arguments");
+        error ("strrep: unknown option: %s", opt.c_str ());
     }
 
+  octave_value retval;
+
   octave_value argstr = args(0);
   octave_value argpat = args(1);
   octave_value argrep = args(2);
--- a/libinterp/corefcn/strfns.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/strfns.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -292,7 +292,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_string ());
+  return ovl (args(0).is_string ());
 }
 
 /*
@@ -555,8 +555,8 @@
   if (args.length () != 2)
     print_usage ();
 
-  return octave_value (do_strcmp_fun (args(0), args(1), 0, "strcmp",
-                                      strcmp_array_op, strcmp_str_op));
+  return ovl (do_strcmp_fun (args(0), args(1), 0, "strcmp",
+                             strcmp_array_op, strcmp_str_op));
 }
 
 /*
@@ -662,20 +662,16 @@
 @seealso{strncmpi, strcmp, strcmpi}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 3)
     print_usage ();
 
   octave_idx_type n = args(2).idx_type_value ();
 
   if (n > 0)
-    retval = do_strcmp_fun (args(0), args(1), n, "strncmp",
-                            strncmp_array_op, strncmp_str_op);
+    return ovl (do_strcmp_fun (args(0), args(1), n, "strncmp",
+                               strncmp_array_op, strncmp_str_op));
   else
     error ("strncmp: N must be greater than 0");
-
-  return retval;
 }
 
 /*
@@ -739,13 +735,11 @@
 @seealso{strcmp, strncmp, strncmpi}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
-  return octave_value (do_strcmp_fun (args(0), args(1), 0, "strcmpi",
-                                      strcmpi_array_op, strcmpi_str_op));
+  return ovl (do_strcmp_fun (args(0), args(1), 0, "strcmpi",
+                             strcmpi_array_op, strcmpi_str_op));
 }
 
 /*
@@ -796,20 +790,16 @@
 @seealso{strncmp, strcmp, strcmpi}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 3)
     print_usage ();
 
   octave_idx_type n = args(2).idx_type_value ();
 
   if (n > 0)
-    retval = do_strcmp_fun (args(0), args(1), n, "strncmpi",
-                            strncmpi_array_op, strncmpi_str_op);
+    return ovl (do_strcmp_fun (args(0), args(1), n, "strncmpi",
+                               strncmpi_array_op, strncmpi_str_op));
   else
     error ("strncmpi: N must be greater than 0");
-
-  return retval;
 }
 
 /*
@@ -852,8 +842,6 @@
 @seealso{terminal_size}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 3)
@@ -875,9 +863,7 @@
 
   s.list_in_columns (buf, width, prefix);
 
-  retval = buf.str ();
-
-  return retval;
+  return ovl (buf.str ());
 }
 
 /*
--- a/libinterp/corefcn/sub2ind.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/sub2ind.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -93,28 +93,26 @@
   dv = dv.redim (nargin - 1);
   for (int j = 0; j < nargin - 1; j++)
     {
-      if (args(j+1).is_numeric_type ())
+      if (! args(j+1).is_numeric_type ())
+        error ("sub2ind: subscripts must be numeric");
+
+      try
         {
-          try
-            {
-              idxa(j) = args(j+1).index_vector ();
+          idxa(j) = args(j+1).index_vector ();
 
-              if (j > 0 && args(j+1).dims () != args(1).dims ())
-                error ("sub2ind: all subscripts must be of the same size");
-            }
-          catch (index_exception& e)
-            {
-              e.set_pos_if_unset (nargin-1, j+1);
-              e.set_var ();
-              std::string msg = e.message ();
-              error_with_id (e.err_id (), msg.c_str ());
-            }
+          if (j > 0 && args(j+1).dims () != args(1).dims ())
+            error ("sub2ind: all subscripts must be of the same size");
         }
-      else
-        error ("sub2ind: subscripts must be numeric");
+      catch (index_exception& e)
+        {
+          e.set_pos_if_unset (nargin-1, j+1);
+          e.set_var ();
+          std::string msg = e.message ();
+          error_with_id (e.err_id (), msg.c_str ());
+        }
     }
 
-  return octave_value (sub2ind (dv, idxa));
+  return ovl (sub2ind (dv, idxa));
 }
 
 /*
@@ -181,11 +179,11 @@
 @seealso{sub2ind}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 2)
     print_usage ();
 
+  octave_value_list retval;
+
   dim_vector dv = get_dim_vector (args(0), "ind2sub");
 
   try
--- a/libinterp/corefcn/svd.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/svd.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -124,8 +124,6 @@
 @seealso{svd_driver, svds, eig, lu, chol, hess, qr, qz}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2 || nargout == 2 || nargout > 3)
@@ -133,18 +131,20 @@
 
   octave_value arg = args(0);
 
-  octave_idx_type nr = arg.rows ();
-  octave_idx_type nc = arg.columns ();
-
   if (arg.ndims () != 2)
     error ("svd: A must be a 2-D matrix");
 
+  octave_value_list retval;
+
   bool isfloat = arg.is_single_type ();
 
   SVD::type type = ((nargout == 0 || nargout == 1)
                     ? SVD::sigma_only
                     : (nargin == 2) ? SVD::economy : SVD::std);
 
+  octave_idx_type nr = arg.rows ();
+  octave_idx_type nc = arg.columns ();
+
   SVD::driver driver = static_cast<SVD::driver> (Vsvd_driver);
 
   if (nr == 0 || nc == 0)
--- a/libinterp/corefcn/sylvester.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/sylvester.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -60,11 +60,11 @@
 @end example\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 3)
     print_usage ();
 
+  octave_value retval;
+
   octave_value arg_a = args(0);
   octave_value arg_b = args(1);
   octave_value arg_c = args(2);
@@ -88,9 +88,9 @@
 
   if (arg_a_is_empty > 0 && arg_b_is_empty > 0 && arg_c_is_empty > 0)
     if (isfloat)
-      return octave_value (FloatMatrix ());
+      return ovl (FloatMatrix ());
     else
-      return octave_value (Matrix ());
+      return ovl (Matrix ());
   else if (arg_a_is_empty || arg_b_is_empty || arg_c_is_empty)
     return retval;
 
--- a/libinterp/corefcn/symtab.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/symtab.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1664,13 +1664,13 @@
 determine whether functions defined in function files need to recompiled.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value retval;
+
   if (nargout > 0 || nargin == 0)
     {
       switch (Vignore_function_time_stamp)
@@ -1744,13 +1744,13 @@
 @seealso{__current_scope__}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 0)
     {
       symbol_table::dump_functions (octave_stdout);
@@ -1809,8 +1809,6 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -1820,6 +1818,8 @@
 
   octave_user_function *f = ov.user_function_value ();
 
+  octave_value_list retval;
+
   if (f)
     {
       std::ostringstream buf;
@@ -1828,7 +1828,7 @@
 
       f->accept (tpc);
 
-      retval = buf.str ();
+      retval = ovl (buf.str ());
     }
 
   return retval;
@@ -1840,8 +1840,6 @@
 
 DEFUN (set_variable, args, , "set_variable (NAME, VALUE)")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -1849,16 +1847,16 @@
 
   symbol_table::assign (name, args(1));
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (variable_value, args, , "VALUE = variable_value (NAME)")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   std::string name = args(0).xstring_value ("variable_value: variable NAME must be a string");
 
   retval = symbol_table::varval (name);
--- a/libinterp/corefcn/syscalls.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/syscalls.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -504,7 +504,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_syscalls::getpid ());
+  return ovl (octave_syscalls::getpid ());
 }
 
 DEFUNX ("getppid", Fgetppid, args, ,
@@ -517,7 +517,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_syscalls::getppid ());
+  return ovl (octave_syscalls::getppid ());
 }
 
 DEFUNX ("getegid", Fgetegid, args, ,
@@ -530,7 +530,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_syscalls::getegid ());
+  return ovl (octave_syscalls::getegid ());
 }
 
 DEFUNX ("getgid", Fgetgid, args, ,
@@ -543,7 +543,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_syscalls::getgid ());
+  return ovl (octave_syscalls::getgid ());
 }
 
 DEFUNX ("geteuid", Fgeteuid, args, ,
@@ -556,7 +556,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_syscalls::geteuid ());
+  return ovl (octave_syscalls::geteuid ());
 }
 
 DEFUNX ("getuid", Fgetuid, args, ,
@@ -569,7 +569,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_syscalls::getuid ());
+  return ovl (octave_syscalls::getuid ());
 }
 
 DEFUNX ("kill", Fkill, args, ,
@@ -882,7 +882,7 @@
 
   double mode = args(0).xdouble_value ("S_ISREG: invalid MODE value");
 
-  return octave_value (file_stat::is_reg (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_reg (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISDIR", FS_ISDIR, args, ,
@@ -899,7 +899,7 @@
 
   double mode = args(0).xdouble_value ("S_ISDIR: invalid MODE value");
 
-  return octave_value (file_stat::is_dir (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_dir (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISCHR", FS_ISCHR, args, ,
@@ -916,7 +916,7 @@
 
   double mode = args(0).xdouble_value ("S_ISCHR: invalid MODE value");
 
-  return octave_value (file_stat::is_chr (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_chr (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISBLK", FS_ISBLK, args, ,
@@ -933,7 +933,7 @@
 
   double mode = args(0).xdouble_value ("S_ISBLK: invalid MODE value");
 
-  return octave_value (file_stat::is_blk (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_blk (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISFIFO", FS_ISFIFO, args, ,
@@ -950,7 +950,7 @@
 
   double mode = args(0).xdouble_value ("S_ISFIFO: invalid MODE value");
 
-  return octave_value (file_stat::is_fifo (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_fifo (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISLNK", FS_ISLNK, args, ,
@@ -967,7 +967,7 @@
 
   double mode = args(0).xdouble_value ("S_ISLNK: invalid MODE value");
 
-  return octave_value (file_stat::is_lnk (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_lnk (static_cast<mode_t> (mode)));
 }
 
 DEFUNX ("S_ISSOCK", FS_ISSOCK, args, ,
@@ -984,7 +984,7 @@
 
   double mode = args(0).xdouble_value ("S_ISSOCK: invalid MODE value");
 
-  return octave_value (file_stat::is_sock (static_cast<mode_t> (mode)));
+  return ovl (file_stat::is_sock (static_cast<mode_t> (mode)));
 }
 
 DEFUN (gethostname, args, ,
@@ -996,7 +996,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_env::get_host_name ());
+  return ovl (octave_env::get_host_name ());
 }
 
 DEFUN (uname, args, ,
@@ -1143,7 +1143,7 @@
 
   int status = args(0).xint_value ("WIFEXITED: STATUS must be an integer");
 
-  return octave_value (octave_wait::ifexited (status));
+  return ovl (octave_wait::ifexited (status));
 }
 
 DEFUNX ("WEXITSTATUS", FWEXITSTATUS, args, ,
@@ -1161,7 +1161,7 @@
 
   int status = args(0).xint_value ("WEXITSTATUS: STATUS must be an integer");
 
-  return octave_value (octave_wait::exitstatus (status));
+  return ovl (octave_wait::exitstatus (status));
 }
 
 DEFUNX ("WIFSIGNALED", FWIFSIGNALED, args, ,
@@ -1177,7 +1177,7 @@
 
   int status = args(0).xint_value ("WIFSIGNALED: STATUS must be an integer");
 
-  return octave_value (octave_wait::ifsignaled (status));
+  return ovl (octave_wait::ifsignaled (status));
 }
 
 DEFUNX ("WTERMSIG", FWTERMSIG, args, ,
@@ -1195,7 +1195,7 @@
 
   int status = args(0).xint_value ("WTERMSIG: STATUS must be an integer");
 
-  return octave_value (octave_wait::termsig (status));
+  return ovl (octave_wait::termsig (status));
 }
 
 DEFUNX ("WCOREDUMP", FWCOREDUMP, args, ,
@@ -1215,7 +1215,7 @@
 
   int status = args(0).xint_value ("WCOREDUMP: STATUS must be an integer");
 
-  return octave_value (octave_wait::coredump (status));
+  return ovl (octave_wait::coredump (status));
 }
 
 DEFUNX ("WIFSTOPPED", FWIFSTOPPED, args, ,
@@ -1234,7 +1234,7 @@
 
   int status = args(0).xint_value ("WIFSTOPPED: STATUS must be an integer");
 
-  return octave_value (octave_wait::ifstopped (status));
+  return ovl (octave_wait::ifstopped (status));
 }
 
 DEFUNX ("WSTOPSIG", FWSTOPSIG, args, ,
@@ -1252,7 +1252,7 @@
 
   int status = args(0).xint_value ("WSTOPSIG: STATUS must be an integer");
 
-  return octave_value (octave_wait::stopsig (status));
+  return ovl (octave_wait::stopsig (status));
 }
 
 DEFUNX ("WIFCONTINUED", FWIFCONTINUED, args, ,
@@ -1268,7 +1268,7 @@
 
   int status = args(0).xint_value ("WIFCONTINUED: STATUS must be an integer");
 
-  return octave_value (octave_wait::ifcontinued (status));
+  return ovl (octave_wait::ifcontinued (status));
 }
 
 DEFUNX ("canonicalize_file_name", Fcanonicalize_file_name, args, ,
--- a/libinterp/corefcn/sysdep.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/sysdep.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -616,7 +616,7 @@
 
   std::string name = args(0).string_value ();
 
-  return octave_value (octave_env::getenv (name));
+  return ovl (octave_env::getenv (name));
 }
 
 /*
@@ -678,7 +678,7 @@
 
   std::string tmp = args(0).string_value ();
 
-  return octave_value (gnulib::unsetenv (tmp.c_str ()));
+  return ovl (gnulib::unsetenv (tmp.c_str ()));
 }
 
 /*
@@ -733,7 +733,7 @@
       retval = s;
     }
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (pause, args, ,
@@ -769,8 +769,6 @@
 @seealso{kbhit}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
@@ -780,7 +778,9 @@
     {
       double dval = args(0).double_value ();
 
-      if (! xisnan (dval))
+      if (xisnan (dval))
+        warning ("pause: NaN is an invalid delay");
+      else
         {
           Fdrawnow ();
 
@@ -792,8 +792,6 @@
           else
             octave_sleep (dval);
         }
-      else
-        warning ("pause: NaN is an invalid delay");
     }
   else
     {
@@ -802,7 +800,7 @@
       octave_kbhit ();
     }
 
-  return retval;
+  return octave_value_list ();
 }
 
 /*
@@ -826,8 +824,8 @@
 {
   oct_mach_info::float_format flt_fmt = oct_mach_info::native_float_format ();
 
-  return octave_value (flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian
-                       || flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian);
+  return ovl (flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian
+              || flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian);
 }
 
 /*
@@ -842,7 +840,7 @@
 {
   oct_mach_info::float_format flt_fmt = oct_mach_info::native_float_format ();
 
-  return octave_value (oct_mach_info::float_format_as_string (flt_fmt));
+  return ovl (oct_mach_info::float_format_as_string (flt_fmt));
 }
 
 /*
@@ -877,8 +875,6 @@
 @end example\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -889,11 +885,9 @@
   sv = file_ops::tilde_expand (sv);
 
   if (arg.is_cellstr ())
-    retval = Cell (arg.dims (), sv);
+    return ovl (Cell (arg.dims (), sv));
   else
-    retval = sv;
-
-  return retval;
+    return ovl (sv);
 }
 
 /*
@@ -916,7 +910,7 @@
 @seealso{getenv}\n\
 @end deftypefn")
 {
-  return octave_value (octave_env::get_home_directory ());
+  return ovl (octave_env::get_home_directory ());
 }
 
 /*
@@ -938,5 +932,5 @@
 @seealso{isguirunning}\n\
 @end deftypefn")
 {
-  return octave_value (display_info::display_available ());
+  return ovl (display_info::display_available ());
 }
--- a/libinterp/corefcn/time.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/time.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -117,7 +117,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_time ());
+  return ovl (octave_time ());
 }
 
 /*
@@ -161,7 +161,7 @@
 
   double tmp = args(0).double_value ();
 
-  return octave_value (mk_tm_map (octave_gmtime (tmp)));
+  return ovl (mk_tm_map (octave_gmtime (tmp)));
 }
 
 /*
@@ -216,7 +216,7 @@
 
   double tmp = args(0).double_value ();
 
-  return octave_value (mk_tm_map (octave_localtime (tmp)));
+  return ovl (mk_tm_map (octave_localtime (tmp)));
 }
 
 /*
@@ -262,7 +262,7 @@
 
   octave_base_tm tm = extract_tm (map, "mktime");
 
-  return octave_value (octave_time (tm));
+  return ovl (octave_time (tm));
 }
 
 /*
@@ -451,7 +451,7 @@
 
   octave_base_tm tm = extract_tm (map, "strftime");
 
-  return octave_value (tm.strftime (fmt));
+  return ovl (tm.strftime (fmt));
 }
 
 /*
--- a/libinterp/corefcn/toplev.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/toplev.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1022,19 +1022,12 @@
 @seealso{unix, dos}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
-  unwind_protect frame;
-
   int nargin = args.length ();
 
   if (nargin == 0 || nargin > 3)
     print_usage ();
 
-  bool return_output = (nargin == 1 && nargout > 1);
-
   system_exec_type type = et_sync;
-
   if (nargin == 3)
     {
       std::string type_str = args(2).xstring_value ("system: TYPE must be a string");
@@ -1047,6 +1040,13 @@
         error ("system: TYPE must be \"sync\" or \"async\"");
     }
 
+  octave_value_list retval;
+
+  // FIXME: Is this unwind_protect frame needed anymore (12/16/15)?
+  unwind_protect frame;
+
+  bool return_output = (nargin == 1 && nargout > 1);
+
   if (nargin > 1)
     {
       try
@@ -1208,8 +1208,6 @@
 @seealso{quit}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -1221,6 +1219,8 @@
     ? args(1).xbool_value ("atexit: FLAG argument must be a logical value")
     : true;
 
+  octave_value_list retval;
+
   if (add_mode)
     octave_add_atexit_function (arg);
   else
@@ -1228,7 +1228,7 @@
       bool found = octave_remove_atexit_function (arg);
 
       if (nargout > 0)
-        retval(0) = found;
+        retval = ovl (found);
     }
 
   return retval;
@@ -1247,8 +1247,6 @@
 @seealso{computer}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #if defined (ENABLE_DYNAMIC_LINKING)
   bool octave_supports_dynamic_linking = true;
 #else
@@ -1512,24 +1510,24 @@
   if (nargin > 1)
     print_usage ();
 
+  octave_value_list retval;
+
   if (nargin == 1)
     {
       std::string arg = args(0).string_value ();
 
-      if (m.isfield (arg))
-        {
-          Cell c = m.contents (arg);
+      if (! m.isfield (arg))
+        error ("octave_config_info: invalid parameter '%s'", arg.c_str ());
+
+      Cell c = m.contents (arg);
 
-          if (c.is_empty ())
-            error ("octave_config_info: no info for '%s'", arg.c_str ());
-          else
-            retval = c(0);
-        }
-      else
-        error ("octave_config_info: invalid parameter '%s'", arg.c_str ());
+      if (c.is_empty ())
+        error ("octave_config_info: no info for '%s'", arg.c_str ());
+
+      retval = ovl (c(0));
     }
   else
-    retval = m;
+    retval = ovl (m);
 
   return retval;
 }
--- a/libinterp/corefcn/tril.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/tril.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -186,20 +186,19 @@
 {
   bool lower = (name == "tril");
 
-  octave_value retval;
   int nargin = args.length ();
-  octave_idx_type k = 0;
   bool pack = false;
 
   if (nargin >= 2 && args(nargin-1).is_string ())
     {
-      pack = args(nargin-1).string_value () == "pack";
+      pack = (args(nargin-1).string_value () == "pack");
       nargin--;
     }
 
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
+  octave_idx_type k = 0;
   if (nargin == 2)
     k = args(1).int_value (true);
 
@@ -210,122 +209,119 @@
     error ("%s: need a 2-D matrix", name.c_str ());
   else if (k < -dims(0) || k > dims(1))
     error ("%s: requested diagonal out of range", name.c_str ());
-  else
+
+  octave_value retval;
+
+  switch (arg.builtin_type ())
     {
-      switch (arg.builtin_type ())
-        {
-        case btyp_double:
-          if (arg.is_sparse_type ())
-            retval = do_trilu (arg.sparse_matrix_value (), k, lower, pack);
-          else
-            retval = do_trilu (arg.array_value (), k, lower, pack);
-          break;
+    case btyp_double:
+      if (arg.is_sparse_type ())
+        retval = do_trilu (arg.sparse_matrix_value (), k, lower, pack);
+      else
+        retval = do_trilu (arg.array_value (), k, lower, pack);
+      break;
 
-        case btyp_complex:
-          if (arg.is_sparse_type ())
-            retval = do_trilu (arg.sparse_complex_matrix_value (), k, lower,
-                               pack);
-          else
-            retval = do_trilu (arg.complex_array_value (), k, lower, pack);
-          break;
+    case btyp_complex:
+      if (arg.is_sparse_type ())
+        retval = do_trilu (arg.sparse_complex_matrix_value (), k, lower,
+                           pack);
+      else
+        retval = do_trilu (arg.complex_array_value (), k, lower, pack);
+      break;
 
-        case btyp_bool:
-          if (arg.is_sparse_type ())
-            retval = do_trilu (arg.sparse_bool_matrix_value (), k, lower,
-                               pack);
-          else
-            retval = do_trilu (arg.bool_array_value (), k, lower, pack);
-          break;
+    case btyp_bool:
+      if (arg.is_sparse_type ())
+        retval = do_trilu (arg.sparse_bool_matrix_value (), k, lower,
+                           pack);
+      else
+        retval = do_trilu (arg.bool_array_value (), k, lower, pack);
+      break;
 
 #define ARRAYCASE(TYP)       \
-          case btyp_ ## TYP: \
-            retval = do_trilu (arg.TYP ## _array_value (), k, lower, pack); \
-            break
+      case btyp_ ## TYP: \
+        retval = do_trilu (arg.TYP ## _array_value (), k, lower, pack); \
+        break
 
-          ARRAYCASE (float);
-          ARRAYCASE (float_complex);
-          ARRAYCASE (int8);
-          ARRAYCASE (int16);
-          ARRAYCASE (int32);
-          ARRAYCASE (int64);
-          ARRAYCASE (uint8);
-          ARRAYCASE (uint16);
-          ARRAYCASE (uint32);
-          ARRAYCASE (uint64);
-          ARRAYCASE (char);
+      ARRAYCASE (float);
+      ARRAYCASE (float_complex);
+      ARRAYCASE (int8);
+      ARRAYCASE (int16);
+      ARRAYCASE (int32);
+      ARRAYCASE (int64);
+      ARRAYCASE (uint8);
+      ARRAYCASE (uint16);
+      ARRAYCASE (uint32);
+      ARRAYCASE (uint64);
+      ARRAYCASE (char);
 
 #undef ARRAYCASE
 
-        default:
-          {
-            // Generic code that works on octave-values, that is slow
-            // but will also work on arbitrary user types
+    default:
+      {
+        // Generic code that works on octave-values, that is slow
+        // but will also work on arbitrary user types
+        if (pack) // FIXME
+          error ("%s: \"pack\" not implemented for class %s",
+                 name.c_str (), arg.class_name ().c_str ());
 
-            if (pack) // FIXME
-              error ("%s: \"pack\" not implemented for class %s",
-                     name.c_str (), arg.class_name ().c_str ());
+        octave_value tmp = arg;
+        if (arg.numel () == 0)
+          return arg;
 
-            octave_value tmp = arg;
-            if (arg.numel () == 0)
-              return arg;
+        octave_idx_type nr = dims(0);
+        octave_idx_type nc = dims(1);
 
-            octave_idx_type nr = dims(0);
-            octave_idx_type nc = dims(1);
+        // The sole purpose of this code is to force the correct matrix size.
+        // This would not be necessary if the octave_value resize function
+        // allowed a fill_value.  It also allows odd attributes in some user
+        // types to be handled.  With a fill_value, it should be replaced with
+        //
+        // octave_value_list ov_idx;
+        // tmp = tmp.resize(dim_vector (0,0)).resize (dims, fill_value);
 
-            // The sole purpose of the below is to force the correct
-            // matrix size. This would not be necessary if the
-            // octave_value resize function allowed a fill_value.
-            // It also allows odd attributes in some user types
-            // to be handled. With a fill_value ot should be replaced
-            // with
-            //
-            // octave_value_list ov_idx;
-            // tmp = tmp.resize(dim_vector (0,0)).resize (dims, fill_value);
+        octave_value_list ov_idx;
+        std::list<octave_value_list> idx_tmp;
+        ov_idx(1) = static_cast<double> (nc+1);
+        ov_idx(0) = Range (1, nr);
+        idx_tmp.push_back (ov_idx);
+        ov_idx(1) = static_cast<double> (nc);
+        tmp = tmp.resize (dim_vector (0,0));
+        tmp = tmp.subsasgn ("(",idx_tmp, arg.do_index_op (ov_idx));
+        tmp = tmp.resize (dims);
 
-            octave_value_list ov_idx;
-            std::list<octave_value_list> idx_tmp;
-            ov_idx(1) = static_cast<double> (nc+1);
-            ov_idx(0) = Range (1, nr);
-            idx_tmp.push_back (ov_idx);
-            ov_idx(1) = static_cast<double> (nc);
-            tmp = tmp.resize (dim_vector (0,0));
-            tmp = tmp.subsasgn ("(",idx_tmp, arg.do_index_op (ov_idx));
-            tmp = tmp.resize (dims);
+        if (lower)
+          {
+            octave_idx_type st = nc < nr + k ? nc : nr + k;
 
-            if (lower)
+            for (octave_idx_type j = 1; j <= st; j++)
               {
-                octave_idx_type st = nc < nr + k ? nc : nr + k;
-
-                for (octave_idx_type j = 1; j <= st; j++)
-                  {
-                    octave_idx_type nr_limit = 1 > j - k ? 1 : j - k;
-                    ov_idx(1) = static_cast<double> (j);
-                    ov_idx(0) = Range (nr_limit, nr);
-                    std::list<octave_value_list> idx;
-                    idx.push_back (ov_idx);
+                octave_idx_type nr_limit = 1 > j - k ? 1 : j - k;
+                ov_idx(1) = static_cast<double> (j);
+                ov_idx(0) = Range (nr_limit, nr);
+                std::list<octave_value_list> idx;
+                idx.push_back (ov_idx);
 
-                    tmp = tmp.subsasgn ("(", idx, arg.do_index_op (ov_idx));
-                  }
+                tmp = tmp.subsasgn ("(", idx, arg.do_index_op (ov_idx));
               }
-            else
-              {
-                octave_idx_type st = k + 1 > 1 ? k + 1 : 1;
+          }
+        else
+          {
+            octave_idx_type st = k + 1 > 1 ? k + 1 : 1;
 
-                for (octave_idx_type j = st; j <= nc; j++)
-                  {
-                    octave_idx_type nr_limit = nr < j - k ? nr : j - k;
-                    ov_idx(1) = static_cast<double> (j);
-                    ov_idx(0) = Range (1, nr_limit);
-                    std::list<octave_value_list> idx;
-                    idx.push_back (ov_idx);
+            for (octave_idx_type j = st; j <= nc; j++)
+              {
+                octave_idx_type nr_limit = nr < j - k ? nr : j - k;
+                ov_idx(1) = static_cast<double> (j);
+                ov_idx(0) = Range (1, nr_limit);
+                std::list<octave_value_list> idx;
+                idx.push_back (ov_idx);
 
-                    tmp = tmp.subsasgn ("(", idx, arg.do_index_op (ov_idx));
-                  }
+                tmp = tmp.subsasgn ("(", idx, arg.do_index_op (ov_idx));
               }
+          }
 
-            retval = tmp;
-          }
-        }
+        retval = tmp;
+      }
     }
 
   return retval;
--- a/libinterp/corefcn/tsearch.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/tsearch.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -70,13 +70,11 @@
 @seealso{delaunay, delaunayn}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
+  if (args.length () != 5)
+    print_usage ();
 
   const double eps = 1.0e-12;
 
-  if (args.length () != 5)
-    print_usage ();
-
   const ColumnVector x (args(0).vector_value ());
   const ColumnVector y (args(1).vector_value ());
   const Matrix elem (args(2).matrix_value ());
@@ -158,9 +156,7 @@
 
     } //endfor # kp
 
-  retval(0) = values;
-
-  return retval;
+  return ovl (values);
 }
 
 /*
--- a/libinterp/corefcn/typecast.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/typecast.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -142,12 +142,13 @@
 @seealso{cast, bitpack, bitunpack, swapbytes}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
+  octave_value retval;
+
   unwind_protect frame;
+
   const void *data = 0;
   octave_idx_type byte_size = 0;
   dim_vector old_dims;
@@ -331,14 +332,14 @@
 @seealso{bitunpack, typecast}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
   if (! args(0).is_bool_type ())
     error ("bitpack: X must be a logical array");
 
+  octave_value retval;
+
   boolNDArray bitp = args(0).bool_array_value ();
 
   std::string numclass = args(1).string_value ();
@@ -440,14 +441,14 @@
 @seealso{bitpack, typecast}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
   if (! (args(0).is_numeric_type () || args(0).is_string ()))
     error ("bitunpack: argument must be a number or a string");
 
+  octave_value retval;
+
   octave_value array = args(0);
 
   if (array.is_string ())
--- a/libinterp/corefcn/urlwrite.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/urlwrite.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -330,8 +330,6 @@
 @seealso{urlread}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   // verify arguments
@@ -340,7 +338,7 @@
 
   std::string url = args(0).xstring_value ("urlwrite: URL must be a string");
 
-  // name to store the file if download is succesful
+  // name to store the file if download is successful
   std::string filename = args(1).xstring_value ("urlwrite: LOCALFILE must be a string");
 
   std::string method;
@@ -376,29 +374,28 @@
 
   url_transfer curl = url_transfer (url, ofile);
 
-  if (curl.is_valid ())
-    {
-      curl.http_action (param, method);
+  octave_value_list retval;
 
-      ofile.close ();
+  if (! curl.is_valid ())
+    error ("support for URL transfers was disabled when Octave was built");
 
-      if (curl.good ())
-        frame.discard ();
+  curl.http_action (param, method);
+
+  ofile.close ();
 
-      if (nargout > 0)
-        {
-          if (curl.good ())
-            retval = ovl (octave_env::make_absolute (filename),
-                          true, std::string ());
-          else
-            retval = ovl (std::string (), false, curl.lasterror ());
-        }
+  if (curl.good ())
+    frame.discard ();
 
-      if (nargout < 2 && ! curl.good ())
-        error ("urlwrite: %s", curl.lasterror ().c_str ());
+  if (nargout > 0)
+    {
+      if (curl.good ())
+        retval = ovl (octave_env::make_absolute (filename), true, "");
+      else
+        retval = ovl ("", false, curl.lasterror ());
     }
-  else
-    error ("support for URL transfers was disabled when Octave was built");
+
+  if (nargout < 2 && ! curl.good ())
+    error ("urlwrite: %s", curl.lasterror ().c_str ());
 
   return retval;
 }
@@ -447,9 +444,6 @@
 @seealso{urlwrite}\n\
 @end deftypefn")
 {
-  // Octave's return value
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   // verify arguments
@@ -478,22 +472,22 @@
 
   url_transfer curl = url_transfer (url, buf);
 
-  if (curl.is_valid ())
-    {
-      curl.http_action (param, method);
+  if (! curl.is_valid ())
+    error ("support for URL transfers was disabled when Octave was built");
+
+  curl.http_action (param, method);
+
+  octave_value_list retval;
 
-      if (nargout > 0)
-        {
-          // Return empty string if no error occurred.
-          retval = ovl (buf.str (), curl.good (),
-                        curl.good () ? "" : curl.lasterror ());
-        }
+  if (nargout > 0)
+    {
+      // Return empty string if no error occurred.
+      retval = ovl (buf.str (), curl.good (),
+                    curl.good () ? "" : curl.lasterror ());
+    }
 
-      if (nargout < 2 && ! curl.good ())
-        error ("urlread: %s", curl.lasterror().c_str());
-    }
-  else
-    error ("support for URL transfers was disabled when Octave was built");
+  if (nargout < 2 && ! curl.good ())
+    error ("urlread: %s", curl.lasterror ().c_str ());
 
   return retval;
 }
@@ -532,21 +526,15 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     error ("__ftp_pwd__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        retval = curl.pwd ();
-      else
-        error ("__ftp_pwd__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_pwd__: invalid ftp handle");
 
-  return retval;
+  return ovl (curl.pwd ());
 }
 
 DEFUN (__ftp_cwd__, args, ,
@@ -555,30 +543,23 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin != 1 && nargin != 2)
     error ("__ftp_cwd__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        {
-          std::string path = "";
+  std::string path = "";
+  if (nargin > 1)
+    path = args(1).xstring_value ("__ftp_cwd__: PATH must be a string");
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-          if (nargin > 1)
-            path = args(1).xstring_value ("__ftp_cwd__: PATH must be a string");
+  if (! curl.is_valid ())
+    error ("__ftp_cwd__: invalid ftp handle");
 
-          curl.cwd (path);
-        }
-      else
-        error ("__ftp_cwd__: invalid ftp handle");
-    }
+  curl.cwd (path);
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_dir__, args, nargout,
@@ -587,71 +568,67 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
+  if (args.length () != 1)
+    error ("__ftp_dir__: incorrect number of arguments");
+
+  url_transfer curl = ch_manager::get_object (args(0));
+
+  if (! curl.is_valid ())
+    error ("__ftp_dir__: invalid ftp handle");
+
   octave_value retval;
 
-  if (args.length () != 1)
-    error ("__ftp_dir__: incorrect number of arguments");
+  if (nargout == 0)
+    curl.dir ();
   else
     {
-      url_transfer curl = ch_manager::get_object (args(0));
-
-      if (curl.is_valid ())
-        {
-          if (nargout == 0)
-            curl.dir ();
-          else
-            {
-              string_vector sv = curl.list ();
-              octave_idx_type n = sv.numel ();
+      string_vector sv = curl.list ();
+      octave_idx_type n = sv.numel ();
 
-              if (n == 0)
-                {
-                  string_vector flds (5);
-
-                  flds(0) = "name";
-                  flds(1) = "date";
-                  flds(2) = "bytes";
-                  flds(3) = "isdir";
-                  flds(4) = "datenum";
-
-                  retval = octave_map (flds);
-                }
-              else
-                {
-                  octave_map st;
+      if (n == 0)
+        {
+          string_vector flds (5);
 
-                  Cell filectime (dim_vector (n, 1));
-                  Cell filesize (dim_vector (n, 1));
-                  Cell fileisdir (dim_vector (n, 1));
-                  Cell filedatenum (dim_vector (n, 1));
-
-                  st.assign ("name", Cell (sv));
-
-                  for (octave_idx_type i = 0; i < n; i++)
-                    {
-                      time_t ftime;
-                      bool fisdir;
-                      double fsize;
-
-                      curl.get_fileinfo (sv(i), fsize, ftime, fisdir);
+          flds(0) = "name";
+          flds(1) = "date";
+          flds(2) = "bytes";
+          flds(3) = "isdir";
+          flds(4) = "datenum";
 
-                      fileisdir (i) = fisdir;
-                      filectime (i) = ctime (&ftime);
-                      filesize (i) = fsize;
-                      filedatenum (i) = double (ftime);
-                    }
-
-                  st.assign ("date", filectime);
-                  st.assign ("bytes", filesize);
-                  st.assign ("isdir", fileisdir);
-                  st.assign ("datenum", filedatenum);
-
-                  retval = st;
-                }
-            }
+          retval = octave_map (flds);
         }
       else
-        error ("__ftp_dir__: invalid ftp handle");
+        {
+          octave_map st;
+
+          Cell filectime (dim_vector (n, 1));
+          Cell filesize (dim_vector (n, 1));
+          Cell fileisdir (dim_vector (n, 1));
+          Cell filedatenum (dim_vector (n, 1));
+
+          st.assign ("name", Cell (sv));
+
+          for (octave_idx_type i = 0; i < n; i++)
+            {
+              time_t ftime;
+              bool fisdir;
+              double fsize;
+
+              curl.get_fileinfo (sv(i), fsize, ftime, fisdir);
+
+              fileisdir (i) = fisdir;
+              filectime (i) = ctime (&ftime);
+              filesize (i) = fsize;
+              filedatenum (i) = double (ftime);
+            }
+
+          st.assign ("date", filectime);
+          st.assign ("bytes", filesize);
+          st.assign ("isdir", fileisdir);
+          st.assign ("datenum", filedatenum);
+
+          retval = st;
+        }
     }
 
   return retval;
@@ -663,21 +640,17 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     error ("__ftp_ascii__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        curl.ascii ();
-      else
-        error ("__ftp_ascii__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_ascii__: invalid ftp handle");
 
-  return retval;
+  curl.ascii ();
+
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_binary__, args, ,
@@ -686,21 +659,17 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     error ("__ftp_binary__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        curl.binary ();
-      else
-        error ("__ftp_binary__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_binary__: invalid ftp handle");
 
-  return retval;
+  curl.binary ();
+
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_close__, args, ,
@@ -709,21 +678,17 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     error ("__ftp_close__: incorrect number of arguments");
-  else
-    {
-      curl_handle h = ch_manager::lookup (args(0));
+
+  curl_handle h = ch_manager::lookup (args(0));
 
-      if (h.ok ())
-        ch_manager::free (h);
-      else
-        error ("__ftp_close__: invalid ftp handle");
-    }
+  if (! h.ok ())
+    error ("__ftp_close__: invalid ftp handle");
 
-  return retval;
+  ch_manager::free (h);
+
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_mode__, args, ,
@@ -732,21 +697,17 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     error ("__ftp_mode__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
+
+  octave_value retval;
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        retval = (curl.is_ascii () ? "ascii" : "binary");
-      else
-        error ("__ftp_binary__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_binary__: invalid ftp handle");
 
-  return retval;
+  return ovl (curl.is_ascii () ? "ascii" : "binary");
 }
 
 DEFUN (__ftp_delete__, args, ,
@@ -755,25 +716,19 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     error ("__ftp_delete__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        {
-          std::string file = args(1).xstring_value ("__ftp_delete__: FILE must be a string");
+  std::string file = args(1).xstring_value ("__ftp_delete__: FILE must be a string");
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-          curl.del (file);
-        }
-      else
-        error ("__ftp_delete__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_delete__: invalid ftp handle");
 
-  return retval;
+  curl.del (file);
+
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_rmdir__, args, ,
@@ -786,21 +741,17 @@
 
   if (args.length () != 2)
     error ("__ftp_rmdir__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        {
-          std::string dir = args(1).xstring_value ("__ftp_rmdir__: DIR must be a string");
+  std::string dir = args(1).xstring_value ("__ftp_rmdir__: DIR must be a string");
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-          curl.rmdir (dir);
-        }
-      else
-        error ("__ftp_rmdir__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_rmdir__: invalid ftp handle");
 
-  return retval;
+  curl.rmdir (dir);
+
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_mkdir__, args, ,
@@ -809,25 +760,19 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     error ("__ftp_mkdir__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        {
-          std::string dir = args(1).xstring_value ("__ftp_mkdir__: DIR must be a string");
+  std::string dir = args(1).xstring_value ("__ftp_mkdir__: DIR must be a string");
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-          curl.mkdir (dir);
-        }
-      else
-        error ("__ftp_mkdir__: invalid ftp handle");
-    }
+  if (! curl.is_valid ())
+    error ("__ftp_mkdir__: invalid ftp handle");
 
-  return retval;
+  curl.mkdir (dir);
+
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_rename__, args, ,
@@ -836,26 +781,20 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 3)
     error ("__ftp_rename__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
+
+  std::string oldname = args(1).xstring_value ("__ftp_rename__: OLDNAME must be a string");
+  std::string newname = args(2).xstring_value ("__ftp_rename__: NEWNAME must be a string");
+
+  url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        {
-          std::string oldname = args(1).xstring_value ("__ftp_rename__: OLDNAME must be a string");
-          std::string newname = args(2).xstring_value ("__ftp_rename__: NEWNAME must be a string");
+  if (curl.is_valid ())
+    error ("__ftp_rename__: invalid ftp handle");
 
-          curl.rename (oldname, newname);
-        }
-      else
-        error ("__ftp_rename__: invalid ftp handle");
-    }
+  curl.rename (oldname, newname);
 
-  return retval;
+  return octave_value_list ();
 }
 
 DEFUN (__ftp_mput__, args, nargout,
@@ -864,67 +803,60 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     error ("__ftp_mput__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
 
-      if (curl.is_valid ())
-        {
-          std::string pat = args(1).xstring_value ("__ftp_mput__: PATTERN must be a string");
+  std::string pat = args(1).xstring_value ("__ftp_mput__: PATTERN must be a string");
 
-          string_vector file_list;
-
-          glob_match pattern (file_ops::tilde_expand (pat));
-          string_vector files = pattern.glob ();
+  url_transfer curl = ch_manager::get_object (args(0));
 
-          for (octave_idx_type i = 0; i < files.numel (); i++)
-            {
-              std::string file = files (i);
-
-              file_stat fs (file);
+  if (! curl.is_valid ())
+    error ("__ftp_mput__: invalid ftp handle");
 
-              if (! fs.exists ())
-                error ("__ftp__mput: file does not exist");
+  string_vector file_list;
 
-              if (fs.is_dir ())
-                {
-                  file_list.append (curl.mput_directory ("", file));
+  glob_match pattern (file_ops::tilde_expand (pat));
+  string_vector files = pattern.glob ();
 
-                  if (! curl.good ())
-                    error ("__ftp_mput__: %s", curl.lasterror().c_str());
-                }
-              else
-                {
-                  // FIXME: Does ascii mode need to be flagged here?
-                  std::ifstream ifile (file.c_str (), std::ios::in |
-                                       std::ios::binary);
+  for (octave_idx_type i = 0; i < files.numel (); i++)
+    {
+      std::string file = files(i);
 
-                  if (! ifile.is_open ())
-                    error ("__ftp_mput__: unable to open file");
+      file_stat fs (file);
 
-                  curl.put (file, ifile);
-
-                  ifile.close ();
-
-                  if (! curl.good ())
-                    error ("__ftp_mput__: %s", curl.lasterror().c_str());
+      if (! fs.exists ())
+        error ("__ftp__mput: file does not exist");
 
-                  file_list.append (file);
-                }
-            }
+      if (fs.is_dir ())
+        {
+          file_list.append (curl.mput_directory ("", file));
 
-          if (nargout > 0)
-            retval = file_list;
+          if (! curl.good ())
+            error ("__ftp_mput__: %s", curl.lasterror ().c_str ());
         }
       else
-        error ("__ftp_mput__: invalid ftp handle");
+        {
+          // FIXME: Does ascii mode need to be flagged here?
+          std::ifstream ifile (file.c_str (), std::ios::in | std::ios::binary);
+
+          if (! ifile.is_open ())
+            error ("__ftp_mput__: unable to open file");
+
+          curl.put (file, ifile);
+
+          ifile.close ();
+
+          if (! curl.good ())
+            error ("__ftp_mput__: %s", curl.lasterror ().c_str ());
+
+          file_list.append (file);
+        }
     }
 
-  return retval;
+  if (nargout > 0)
+    return ovl (file_list);
+  else
+    return octave_value_list ();
 }
 
 DEFUN (__ftp_mget__, args, ,
@@ -934,75 +866,69 @@
 Undocumented internal function\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin != 2 && nargin != 3)
     error ("__ftp_mget__: incorrect number of arguments");
-  else
-    {
-      url_transfer curl = ch_manager::get_object (args(0));
+
+  std::string file = args(1).xstring_value ("__ftp_mget__: PATTERN must be a string");
+
+  std::string target;
 
-      if (curl.is_valid ())
-        {
-          std::string file = args(1).xstring_value ("__ftp_mget__: PATTERN must be a string");
-          std::string target;
+  if (nargin == 3 && ! args(2).is_empty ())
+    target = args(2).xstring_value ("__ftp_mget__: TARGET must be a string") + file_ops::dir_sep_str ();
 
-          if (nargin == 3 && ! args(2).is_empty ())
-            target = args(2).xstring_value ("__ftp_mget__: TARGET must be a string") + file_ops::dir_sep_str ();
+  url_transfer curl = ch_manager::get_object (args(0));
 
-          string_vector sv = curl.list ();
-          octave_idx_type n = 0;
-          glob_match pattern (file);
-
+  if (! curl.is_valid ())
+    error ("__ftp_mget__: invalid ftp handle");
 
-          for (octave_idx_type i = 0; i < sv.numel (); i++)
-            {
-              if (pattern.match (sv(i)))
-                {
-                  n++;
+  string_vector sv = curl.list ();
+  octave_idx_type n = 0;
+  glob_match pattern (file);
 
-                  time_t ftime;
-                  bool fisdir;
-                  double fsize;
+  for (octave_idx_type i = 0; i < sv.numel (); i++)
+    {
+      if (pattern.match (sv(i)))
+        {
+          n++;
 
-                  curl.get_fileinfo (sv(i), fsize, ftime, fisdir);
+          time_t ftime;
+          bool fisdir;
+          double fsize;
+
+          curl.get_fileinfo (sv(i), fsize, ftime, fisdir);
 
-                  if (fisdir)
-                    curl.mget_directory (sv(i), target);
-                  else
-                    {
-                      std::ofstream ofile ((target + sv(i)).c_str (),
-                                           std::ios::out |
-                                           std::ios::binary);
-
-                      if (! ofile.is_open ())
-                        error ("__ftp_mget__: unable to open file");
+          if (fisdir)
+            curl.mget_directory (sv(i), target);
+          else
+            {
+              std::ofstream ofile ((target + sv(i)).c_str (),
+                                   std::ios::out |
+                                   std::ios::binary);
 
-                      unwind_protect_safe frame;
-
-                      frame.add_fcn (delete_file, target + sv(i));
+              if (! ofile.is_open ())
+                error ("__ftp_mget__: unable to open file");
 
-                      curl.get (sv(i), ofile);
+              unwind_protect_safe frame;
 
-                      ofile.close ();
+              frame.add_fcn (delete_file, target + sv(i));
 
-                      if (curl.good ())
-                        frame.discard ();
-                    }
+              curl.get (sv(i), ofile);
 
-                  if (! curl.good ())
-                    error ("__ftp_mget__: %s", curl.lasterror().c_str());
-                }
+              ofile.close ();
+
+              if (curl.good ())
+                frame.discard ();
             }
 
-          if (n == 0)
-            error ("__ftp_mget__: file not found");
+          if (! curl.good ())
+            error ("__ftp_mget__: %s", curl.lasterror().c_str());
         }
-      else
-        error ("__ftp_mget__: invalid ftp handle");
     }
 
-  return retval;
+  if (n == 0)
+    error ("__ftp_mget__: file not found");
+
+  return octave_value_list ();
 }
--- a/libinterp/corefcn/utils.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/utils.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -99,11 +99,11 @@
 @seealso{iskeyword, exist, who}\n\
 @end deftypefn")
 {
-  octave_value retval = false;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval = false;
+
   if (args(0).is_string ())
     {
       std::string varname = args(0).string_value ();
@@ -308,8 +308,6 @@
 @seealso{file_in_path, dir_in_loadpath, path}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -317,24 +315,22 @@
 
   string_vector names = args(0).xall_strings ("file_in_loadpath: FILE argument must be a string");
 
-  if (names.numel () > 0)
-    {
-      if (nargin == 1)
-        retval =
-          octave_env::make_absolute (load_path::find_first_of (names));
-      else if (nargin == 2)
-        {
-          std::string opt = args(1).xstring_value ("file_in_loadpath: optional second argument must be a string");
+  octave_value retval;
+
+  if (names.numel () == 0)
+    error ("file_in_loadpath: FILE argument must not be empty");
 
-          if (opt == "all")
-            retval = Cell (make_absolute
-                           (load_path::find_all_first_of (names)));
-          else
-            error ("file_in_loadpath: \"all\" is only valid second argument");
-        }
+  if (nargin == 1)
+    retval = octave_env::make_absolute (load_path::find_first_of (names));
+  else
+    {
+      std::string opt = args(1).xstring_value ("file_in_loadpath: optional second argument must be a string");
+
+      if (opt != "all")
+        error ("file_in_loadpath: \"all\" is only valid second argument");
+
+      retval = Cell (make_absolute (load_path::find_all_first_of (names)));
     }
-  else
-    error ("file_in_loadpath: FILE argument must not be empty");
 
   return retval;
 }
@@ -385,8 +381,6 @@
 @seealso{file_in_loadpath, dir_in_loadpath, path}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 2 || nargin > 3)
@@ -396,23 +390,22 @@
 
   string_vector names = args(1).xall_strings ("file_in_path: FILE argument must be a string");
 
-  if (names.numel () > 0)
-    {
-      if (nargin == 2)
-        retval = search_path_for_file (path, names);
-      else if (nargin == 3)
-        {
-          std::string opt = args(2).xstring_value ("file_in_path: optional third argument must be a string");
+  octave_value retval;
+
+  if (names.numel () == 0)
+    error ("file_in_path: FILE argument must not be empty");
 
-          if (opt == "all")
-            retval = Cell (make_absolute
-                           (search_path_for_all_files (path, names)));
-          else
-            error ("file_in_path: \"all\" is only valid third argument");
-        }
+  if (nargin == 2)
+    retval = search_path_for_file (path, names);
+  else
+    {
+      std::string opt = args(2).xstring_value ("file_in_path: optional third argument must be a string");
+
+      if (opt != "all")
+        error ("file_in_path: \"all\" is only valid third argument");
+
+      retval = Cell (make_absolute (search_path_for_all_files (path, names)));
     }
-  else
-    error ("file_in_path: FILE argument must not be empty");
 
   return retval;
 }
@@ -751,7 +744,7 @@
 
   std::string str = args(0).xstring_value ("do_string_escapes: STRING argument must be of type string");
 
-  return octave_value (do_string_escapes (str));
+  return ovl (do_string_escapes (str));
 }
 
 /*
@@ -886,7 +879,7 @@
 
   std::string str = args(0).xstring_value ("undo_string_escapes: S argument must be a string");
 
-  return octave_value (undo_string_escapes (str));
+  return ovl (undo_string_escapes (str));
 }
 
 /*
@@ -918,15 +911,11 @@
 @seealso{is_rooted_relative_filename, make_absolute_filename, isdir}\n\
 @end deftypefn")
 {
-  octave_value retval = false;
-
   if (args.length () != 1)
     print_usage ();
 
-  retval = (args(0).is_string ()
-            && octave_env::absolute_pathname (args(0).string_value ()));
-
-  return retval;
+  return ovl (args(0).is_string ()
+              && octave_env::absolute_pathname (args(0).string_value ()));
 }
 
 /*
@@ -948,10 +937,8 @@
   if (args.length () != 1)
     print_usage ();
 
-  retval = (args(0).is_string ()
-            && octave_env::rooted_relative_pathname (args(0).string_value ()));
-
-  return retval;
+  return ovl (args(0).is_string ()
+              && octave_env::rooted_relative_pathname (args(0).string_value ()));
 }
 
 /*
@@ -976,7 +963,7 @@
 
   std::string nm = args(0).xstring_value ("make_absolute_filename: FILE argument must be a filename");
 
-  return octave_value (octave_env::make_absolute (nm));
+  return ovl (octave_env::make_absolute (nm));
 }
 
 /*
@@ -1003,8 +990,6 @@
 @seealso{file_in_path, file_in_loadpath, path}\n\
 @end deftypefn")
 {
-  octave_value retval = std::string ();
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -1015,11 +1000,9 @@
   dir = args(0).xstring_value ("dir_in_loadpath: DIR must be a directory name");
 
   if (nargin == 1)
-    retval = load_path::find_dir (dir);
-  else if (nargin == 2)
-    retval = Cell (load_path::find_matching_dirs (dir));
-
-  return retval;
+    return ovl (load_path::find_dir (dir));
+  else
+    return ovl (Cell (load_path::find_matching_dirs (dir)));
 }
 
 /*
@@ -1052,13 +1035,13 @@
 @seealso{errno_list}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 1)
     {
       if (args(0).is_string ())
@@ -1105,7 +1088,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (octave_errno::list ());
+  return ovl (octave_errno::list ());
 }
 
 /*
@@ -1390,18 +1373,17 @@
 character @nospell{\"@xbackslashchar{}0\"}, it will always be a valid index.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-  octave_idx_type n = 0;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
+  octave_idx_type n = 0;
   if (nargin == 2)
     n = args(1).idx_type_value ();
 
+  octave_value retval;
+
   unwind_protect frame;
 
   frame.protect_var (discard_error_messages);
@@ -1527,7 +1509,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  return octave_value (false);
+  return ovl (false);
 }
 
 /*
--- a/libinterp/corefcn/variables.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/corefcn/variables.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -324,8 +324,6 @@
 static octave_value
 do_isglobal (const octave_value_list& args)
 {
-  octave_value retval = false;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -578,8 +576,6 @@
 @seealso{file_in_loadpath, file_in_path, dir_in_loadpath, stat}\n\
 @end deftypefn")
 {
-  octave_value retval = false;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -594,12 +590,10 @@
       if (type == "class")
         warning ("exist: \"class\" type argument is not implemented");
 
-      retval = symbol_exist (name, type);
+      return ovl (symbol_exist (name, type));
     }
   else
-    retval = symbol_exist (name);
-
-  return retval;
+    return ovl (symbol_exist (name));
 }
 
 /*
@@ -729,10 +723,7 @@
           retval = true;
         }
       else
-        {
-          error_with_cfn ("second argument must be \"local\"");
-          nargin = 0;
-        }
+        error_with_cfn ("second argument must be \"local\"");
     }
 
   return retval;
@@ -769,14 +760,15 @@
         warning ("\"local\" has no effect outside a function");
     }
 
+  if (nargin > 1)
+    print_usage ();
+
   if (nargin == 1)
     {
       bool bval = args(0).xbool_value ("%s: argument must be a logical value", nm);
 
       var = bval;
     }
-  else if (nargin > 1)
-    print_usage ();
 
   return retval;
 }
@@ -798,6 +790,9 @@
         warning ("\"local\" has no effect outside a function");
     }
 
+  if (nargin > 1)
+    print_usage ();
+
   if (nargin == 1)
     {
       std::string sval = args(0).xstring_value ("%s: argument must be a single character", nm);
@@ -817,8 +812,6 @@
           break;
         }
     }
-  else if (nargin > 1)
-    print_usage ();
 
   return retval;
 }
@@ -841,6 +834,9 @@
         warning ("\"local\" has no effect outside a function");
     }
 
+  if (nargin > 1)
+    print_usage ();
+
   if (nargin == 1)
     {
       int ival = args(0).xint_value ("%s: argument must be an integer value", nm);
@@ -853,8 +849,6 @@
       else
         var = ival;
     }
-  else if (nargin > 1)
-    print_usage ();
 
   return retval;
 }
@@ -877,6 +871,9 @@
         warning ("\"local\" has no effect outside a function");
     }
 
+  if (nargin > 1)
+    print_usage ();
+
   if (nargin == 1)
     {
       double dval = args(0).xscalar_value ("%s: argument must be a scalar value", nm);
@@ -888,8 +885,6 @@
       else
         var = dval;
     }
-  else if (nargin > 1)
-    print_usage ();
 
   return retval;
 }
@@ -911,6 +906,9 @@
         warning ("\"local\" has no effect outside a function");
     }
 
+  if (nargin > 1)
+    print_usage ();
+
   if (nargin == 1)
     {
       std::string sval = args(0).xstring_value ("%s: first argument must be a string", nm);
@@ -920,8 +918,6 @@
       else
         error ("%s: value must not be empty", nm);
     }
-  else if (nargin > 1)
-    print_usage ();
 
   return retval;
 }
@@ -948,6 +944,9 @@
         warning ("\"local\" has no effect outside a function");
     }
 
+  if (nargin > 1)
+    print_usage ();
+
   if (nargin == 1)
     {
       std::string sval = args(0).xstring_value ("%s: first argument must be a string", nm);
@@ -964,8 +963,6 @@
       if (i == nchoices)
         error ("%s: value not allowed (\"%s\")", nm, sval.c_str ());
     }
-  else if (nargin > 1)
-    print_usage ();
 
   return retval;
 }
@@ -1985,19 +1982,17 @@
 @seealso{munlock, mislocked, persistent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 0)
     print_usage ();
 
   octave_function *fcn = octave_call_stack::caller ();
 
-  if (fcn)
+  if (! fcn)
+    error ("mlock: invalid use outside a function");
+
     fcn->lock ();
-  else
-    error ("mlock: invalid use outside a function");
-
-  return retval;
+
+  return octave_value_list ();
 }
 
 DEFUN (munlock, args, ,
@@ -2010,8 +2005,6 @@
 @seealso{mlock, mislocked, persistent}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
@@ -2027,13 +2020,13 @@
     {
       octave_function *fcn = octave_call_stack::caller ();
 
-      if (fcn)
-        fcn->unlock ();
-      else
+      if (! fcn)
         error ("munlock: invalid use outside a function");
+
+      fcn->unlock ();
     }
 
-  return retval;
+  return octave_value_list ();
 }
 
 
@@ -2047,13 +2040,13 @@
 @seealso{mlock, munlock, persistent}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 1)
     {
       std::string name = args(0).xstring_value ("mislocked: FCN must be a string");
@@ -2064,10 +2057,10 @@
     {
       octave_function *fcn = octave_call_stack::caller ();
 
-      if (fcn)
-        retval = fcn->islocked ();
-      else
+      if (! fcn)
         error ("mislocked: invalid use outside a function");
+
+      retval = fcn->islocked ();
     }
 
   return retval;
--- a/libinterp/dldfcn/__delaunayn__.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/__delaunayn__.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -88,16 +88,17 @@
 @end deftypefn")
 
 {
-  octave_value_list retval;
+#if defined (HAVE_QHULL)
+
+  int nargin = args.length ();
 
-#if defined (HAVE_QHULL)
+  if (nargin < 1 || nargin > 2)
+    print_usage ();
+
+  octave_value_list retval;
 
   retval(0) = 0.0;
 
-  int nargin = args.length ();
-  if (nargin < 1 || nargin > 2)
-    print_usage ();
-
   Matrix p (args(0).matrix_value ());
   const octave_idx_type dim = p.columns ();
   const octave_idx_type n = p.rows ();
@@ -151,56 +152,54 @@
 #endif
       FILE *errfile = stderr;
 
-      if (outfile)
-        frame.add_fcn (close_fcn, outfile);
-      else
+      if (! outfile)
         error ("__delaunayn__: unable to create temporary file for output");
 
+      frame.add_fcn (close_fcn, outfile);
+
       int exitcode = qh_new_qhull (dim, n, pt_array,
                                    ismalloc, flags, outfile, errfile);
+      if (exitcode)
+        error ("__delaunayn__: qhull failed");
+
+      // triangulate non-simplicial facets
+      qh_triangulate ();
+
+      facetT *facet;
+      vertexT *vertex, **vertexp;
+      octave_idx_type nf = 0;
+      octave_idx_type i = 0;
+
+      FORALLfacets
+        {
+          if (! facet->upperdelaunay)
+            nf++;
+
+          // Double check.  Non-simplicial facets will cause segfault below
+          if (! facet->simplicial)
+            error ("__delaunayn__: Qhull returned non-simplicial facets -- try delaunayn with different options");
+        }
+
       if (! exitcode)
         {
-          // triangulate non-simplicial facets
-          qh_triangulate ();
-
-          facetT *facet;
-          vertexT *vertex, **vertexp;
-          octave_idx_type nf = 0;
-          octave_idx_type i = 0;
+          Matrix simpl (nf, dim+1);
 
           FORALLfacets
             {
               if (! facet->upperdelaunay)
-                nf++;
+                {
+                  octave_idx_type j = 0;
 
-              // Double check.  Non-simplicial facets will cause segfault below
-              if (! facet->simplicial)
-                error ("__delaunayn__: Qhull returned non-simplicial facets -- try delaunayn with different options");
+                  FOREACHvertex_ (facet->vertices)
+                    {
+                      simpl(i, j++) = 1 + qh_pointid(vertex->point);
+                    }
+                  i++;
+                }
             }
 
-          if (! exitcode)
-            {
-              Matrix simpl (nf, dim+1);
-
-              FORALLfacets
-                {
-                  if (! facet->upperdelaunay)
-                    {
-                      octave_idx_type j = 0;
-
-                      FOREACHvertex_ (facet->vertices)
-                        {
-                          simpl(i, j++) = 1 + qh_pointid(vertex->point);
-                        }
-                      i++;
-                    }
-                }
-
-              retval(0) = simpl;
-            }
+          retval(0) = simpl;
         }
-      else
-        error ("__delaunayn__: qhull failed");
 
       // Free memory from Qhull
       qh_freeqhull (! qh_ALL);
@@ -223,13 +222,13 @@
       retval(0) = vec;
     }
 
+  return retval;
+
 #else
 
   error ("__delaunayn__: not available in this version of Octave");
 
 #endif
-
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/__eigs__.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/__eigs__.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -146,9 +146,14 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value_list retval;
 #ifdef HAVE_ARPACK
   int nargin = args.length ();
+
+  if (nargin == 0)
+    print_usage ();
+
+  octave_value_list retval;
+
   std::string fcn_name;
   octave_idx_type n = 0;
   octave_idx_type k = 6;
@@ -194,9 +199,6 @@
       return retval;
     }
 
-  if (nargin == 0)
-    print_usage ();
-
   if (args(0).is_function_handle () || args(0).is_inline_function ()
       || args(0).is_string ())
     {
@@ -218,12 +220,10 @@
 
       if (nargin < 2)
         error ("eigs: incorrect number of arguments");
-      else
-        {
-          n = args(1).nint_value ();
-          arg_offset = 1;
-          have_a_fun = true;
-        }
+
+      n = args(1).nint_value ();
+      arg_offset = 1;
+      have_a_fun = true;
     }
   else
     {
@@ -252,10 +252,9 @@
               amm = (args(0).matrix_value ());
             }
         }
-
     }
 
-  // Note hold off reading B till later to avoid issues of double
+  // Note hold off reading B until later to avoid issues of double
   // copies of the matrix if B is full/real while A is complex.
   if (nargin > 1 + arg_offset
       && ! (args(1 + arg_offset).is_real_scalar ()))
@@ -302,60 +301,58 @@
 
   if (nargin > (3+arg_offset))
     {
-      if (args(3+arg_offset).is_map ())
-        {
-          octave_scalar_map map = args(3+arg_offset).xscalar_map_value ("eigs: OPTS argument must be a scalar structure");
+      if (! args(3+arg_offset).is_map ())
+        error ("eigs: OPTS argument must be a structure");
 
-          octave_value tmp;
+      octave_scalar_map map = args(3+arg_offset).xscalar_map_value ("eigs: OPTS argument must be a scalar structure");
+
+      octave_value tmp;
 
-          // issym is ignored for complex matrix inputs
-          tmp = map.getfield ("issym");
-          if (tmp.is_defined () && !sym_tested)
-            {
-              symmetric = tmp.double_value () != 0.;
-              sym_tested = true;
-            }
+      // issym is ignored for complex matrix inputs
+      tmp = map.getfield ("issym");
+      if (tmp.is_defined () && !sym_tested)
+        {
+          symmetric = tmp.double_value () != 0.;
+          sym_tested = true;
+        }
 
-          // isreal is ignored if A is not a function
-          tmp = map.getfield ("isreal");
-          if (tmp.is_defined () && have_a_fun)
-            a_is_complex = ! (tmp.double_value () != 0.);
+      // isreal is ignored if A is not a function
+      tmp = map.getfield ("isreal");
+      if (tmp.is_defined () && have_a_fun)
+        a_is_complex = ! (tmp.double_value () != 0.);
 
-          tmp = map.getfield ("tol");
-          if (tmp.is_defined ())
-            tol = tmp.double_value ();
-
-          tmp = map.getfield ("maxit");
-          if (tmp.is_defined ())
-            maxit = tmp.nint_value ();
+      tmp = map.getfield ("tol");
+      if (tmp.is_defined ())
+        tol = tmp.double_value ();
 
-          tmp = map.getfield ("p");
-          if (tmp.is_defined ())
-            p = tmp.nint_value ();
+      tmp = map.getfield ("maxit");
+      if (tmp.is_defined ())
+        maxit = tmp.nint_value ();
 
-          tmp = map.getfield ("v0");
-          if (tmp.is_defined ())
-            {
-              if (a_is_complex || b_is_complex)
-                cresid = ComplexColumnVector (tmp.complex_vector_value ());
-              else
-                resid = ColumnVector (tmp.vector_value ());
-            }
+      tmp = map.getfield ("p");
+      if (tmp.is_defined ())
+        p = tmp.nint_value ();
 
-          tmp = map.getfield ("disp");
-          if (tmp.is_defined ())
-            disp = tmp.nint_value ();
+      tmp = map.getfield ("v0");
+      if (tmp.is_defined ())
+        {
+          if (a_is_complex || b_is_complex)
+            cresid = ComplexColumnVector (tmp.complex_vector_value ());
+          else
+            resid = ColumnVector (tmp.vector_value ());
+        }
 
-          tmp = map.getfield ("cholB");
-          if (tmp.is_defined ())
-            cholB = tmp.double_value () != 0.;
+      tmp = map.getfield ("disp");
+      if (tmp.is_defined ())
+        disp = tmp.nint_value ();
 
-          tmp = map.getfield ("permB");
-          if (tmp.is_defined ())
-            permB = ColumnVector (tmp.vector_value ()) - 1.0;
-        }
-      else
-        error ("eigs: OPTS argument must be a structure");
+      tmp = map.getfield ("cholB");
+      if (tmp.is_defined ())
+        cholB = tmp.double_value () != 0.;
+
+      tmp = map.getfield ("permB");
+      if (tmp.is_defined ())
+        permB = ColumnVector (tmp.vector_value ()) - 1.0;
     }
 
   if (nargin > (4+arg_offset))
@@ -564,9 +561,9 @@
   if (! fcn_name.empty ())
     clear_function (fcn_name);
 
+  return retval;
+
 #else
   error ("eigs: not available in this version of Octave");
 #endif
-
-  return retval;
 }
--- a/libinterp/dldfcn/__glpk__.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/__glpk__.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -335,16 +335,13 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
 #if defined (HAVE_GLPK)
 
   // FIXME: Should we even need checking for an internal function?
   if (args.length () != 9)
     print_usage ();
 
-  //-- 1nd Input. A column array containing the objective function
-  //--            coefficients.
+  // 1nd Input.  A column array containing the objective function coefficients.
   volatile int mrowsc = args(0).rows ();
 
   Matrix C = args(0).xmatrix_value ("__glpk__: invalid value of C");
@@ -356,7 +353,7 @@
   volatile int mrowsA;
   volatile int nz = 0;
 
-  //-- 2nd Input. A matrix containing the constraints coefficients.
+  // 2nd Input.  A matrix containing the constraints coefficients.
   // If matrix A is NOT a sparse matrix
   if (args(1).is_sparse_type ())
     {
@@ -629,15 +626,13 @@
   extra.assign ("time", time);
   extra.assign ("status", status);
 
-  retval = ovl (xmin, fmin, errnum, extra);
+  return ovl (xmin, fmin, errnum, extra);
 
 #else
 
   gripe_not_supported ("glpk");
 
 #endif
-
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/__magick_read__.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/__magick_read__.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -753,18 +753,15 @@
 @seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
-  octave_value_list output;
-
-#ifndef HAVE_MAGICK
-  gripe_disabled_feature ("imread", "Image IO");
-#else
+#ifdef HAVE_MAGICK
+  if (args.length () != 2 || ! args(0).is_string ())
+    print_usage ();
 
   maybe_initialize_magick ();
 
-  if (args.length () != 2 || ! args(0).is_string ())
-    print_usage ();
+  const octave_scalar_map options = args(1).xscalar_map_value ("__magick_read__: OPTIONS must be a struct");
 
-  const octave_scalar_map options = args(1).xscalar_map_value ("__magick_read__: OPTIONS must be a struct");
+  octave_value_list output;
 
   std::vector<Magick::Image> imvec;
   read_file (args(0).string_value (), imvec);
@@ -849,8 +846,11 @@
                depth);
     }
 
+  return output;
+
+#else
+  gripe_disabled_feature ("imread", "Image IO");
 #endif
-  return output;
 }
 
 /*
@@ -1390,17 +1390,12 @@
 @seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
-#ifndef HAVE_MAGICK
-  gripe_disabled_feature ("imwrite", "Image IO");
-#else
+#ifdef HAVE_MAGICK
+  if (args.length () != 5 || ! args(0).is_string () || ! args(1).is_string ())
+    print_usage ();
 
   maybe_initialize_magick ();
 
-  if (args.length () != 5 || ! args(0).is_string () || ! args(1).is_string ())
-    print_usage ();
-
   const std::string filename = args(0).string_value ();
   const std::string ext = args(1).string_value ();
 
@@ -1542,8 +1537,11 @@
 
   write_file (filename, ext, imvec);
 
+  return octave_value_list ();
+
+#else
+  gripe_disabled_feature ("imwrite", "Image IO");
 #endif
-  return retval;
 }
 
 /*
@@ -1565,17 +1563,14 @@
 @seealso{imfinfo}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-#ifndef HAVE_MAGICK
-  gripe_disabled_feature ("imfinfo", "Image IO");
-#else
-  maybe_initialize_magick ();
-
+#ifdef HAVE_MAGICK
   if (args.length () < 1 || ! args(0).is_string ())
     print_usage ();
 
+  maybe_initialize_magick ();
+
   const std::string filename = args(0).string_value ();
+
   int idx;
   if (args.length () > 1)
     idx = args(1).int_value () -1;
@@ -1603,9 +1598,12 @@
   ping.setfield ("rows",    octave_value (img.rows ()));
   ping.setfield ("columns", octave_value (img.columns ()));
   ping.setfield ("format",  octave_value (img.magick ()));
-  retval = octave_value (ping);
+
+  return ovl (ping);
+
+#else
+  gripe_disabled_feature ("imfinfo", "Image IO");
 #endif
-  return retval;
 }
 
 #ifdef HAVE_MAGICK
@@ -1785,16 +1783,12 @@
 @seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-#ifndef HAVE_MAGICK
-  gripe_disabled_feature ("imfinfo", "Image IO");
-#else
-  maybe_initialize_magick ();
-
+#ifdef HAVE_MAGICK
   if (args.length () < 1 || ! args(0).is_string ())
     print_usage ();
 
+  maybe_initialize_magick ();
+
   const std::string filename = args(0).string_value ();
 
   std::vector<Magick::Image> imvec;
@@ -1885,18 +1879,16 @@
   template_info.setfield ("FormatVersion", octave_value (""));
 
   const file_stat fs (filename);
-  if (fs)
-    {
-      const octave_localtime mtime (fs.mtime ());
-      const std::string filetime = mtime.strftime ("%e-%b-%Y %H:%M:%S");
-      template_info.setfield ("Filename",    octave_value (filename));
-      template_info.setfield ("FileModDate", octave_value (filetime));
-      template_info.setfield ("FileSize",    octave_value (fs.size ()));
-    }
-  else
+  if (! fs)
     error ("imfinfo: error reading '%s': %s", filename.c_str (),
            fs.error ().c_str ());
 
+  const octave_localtime mtime (fs.mtime ());
+  const std::string filetime = mtime.strftime ("%e-%b-%Y %H:%M:%S");
+  template_info.setfield ("Filename",    octave_value (filename));
+  template_info.setfield ("FileModDate", octave_value (filetime));
+  template_info.setfield ("FileSize",    octave_value (fs.size ()));
+
   for (octave_idx_type frame = 0; frame < nFrames; frame++)
     {
       OCTAVE_QUIT;
@@ -2214,9 +2206,11 @@
     info.setfield ("DisposalMethod",
                    Cell (dim_vector (nFrames, 1), octave_value ("")));
 
-  retval = octave_value (info);
+  return ovl (info);
+
+#else
+  gripe_disabled_feature ("imfinfo", "Image IO");
 #endif
-  return retval;
 }
 
 /*
@@ -2232,17 +2226,14 @@
 @seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
-  octave_value retval;
+#ifdef HAVE_MAGICK
+  maybe_initialize_magick ();
 
-#ifndef HAVE_MAGICK
-  gripe_disabled_feature ("imformats", "Image IO");
-#else
   if (args.length () != 1 || ! args(0).is_map ())
     print_usage ();
 
   octave_map formats = args(0).map_value ();
 
-  maybe_initialize_magick ();
   for (octave_idx_type idx = 0; idx < formats.numel (); idx++)
     {
       try
@@ -2268,9 +2259,12 @@
           idx--;
         }
     }
-  retval = formats;
+
+  return ovl (formats);
+
+#else
+  gripe_disabled_feature ("imformats", "Image IO");
 #endif
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/__osmesa_print__.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/__osmesa_print__.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -87,12 +87,9 @@
 \n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
 #if ! defined (HAVE_OSMESA)
   gripe_disabled_feature ("__osmesa_print__", "offscreen rendering");
 #else
-
   int nargin = args.length ();
 
   if (nargin != 1 && nargin != 3)
@@ -108,6 +105,8 @@
 #endif
     }
 
+  octave_value_list retval;
+
   int h = args(0).double_value ();
   graphics_object fobj = gh_manager::get_object (h);
   if (! (fobj && fobj.isa ("figure")))
@@ -184,20 +183,18 @@
           // write gl2ps output directly to file
           FILE *filep = gnulib::fopen (file.substr (pos_c).c_str (), "w");
 
-          if (filep)
-            {
-              unwind_protect frame;
+          if (! filep)
+            error ("__osmesa_print__: Couldn't create file \"%s\"", file.c_str ());
 
-              frame.add_fcn (close_fcn, filep);
+          unwind_protect frame;
 
-              glps_renderer rend (filep, term);
-              rend.draw (fobj, "");
+          frame.add_fcn (close_fcn, filep);
 
-              // Make sure buffered commands are finished!!!
-              glFinish ();
-            }
-          else
-            error ("__osmesa_print__: Couldn't create file \"%s\"", file.c_str ());
+          glps_renderer rend (filep, term);
+          rend.draw (fobj, "");
+
+          // Make sure buffered commands are finished!!!
+          glFinish ();
         }
 #endif
     }
@@ -237,8 +234,8 @@
 
   OSMesaDestroyContext (ctx);
 
+  return retval;
 #endif
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/__voronoi__.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/__voronoi__.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -82,24 +82,22 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value_list retval;
+#if defined (HAVE_QHULL)
+  int nargin = args.length ();
+
+  if (nargin < 2 || nargin > 3)
+    print_usage ();
 
   std::string caller = args(0).xstring_value ("__voronoi__: CALLER must be a string");
 
-#if defined (HAVE_QHULL)
-
-  retval(0) = 0.0;
-
-  int nargin = args.length ();
-  if (nargin < 2 || nargin > 3)
-    print_usage ();
+  octave_value_list retval;
 
   Matrix points = args(1).matrix_value ();
   const octave_idx_type dim = points.columns ();
   const octave_idx_type num_points = points.rows ();
 
   if (! octave_qhull_dims_ok (dim, num_points, "__voronoi__"))
-    return retval;
+    return ovl (0.0);
 
   points = points.transpose ();
 
@@ -144,11 +142,11 @@
 #endif
   FILE *errfile = stderr;
 
-  if (outfile)
-    frame.add_fcn (close_fcn, outfile);
-  else
+  if (! outfile)
     error ("__voronoi__: unable to create temporary file for output");
 
+  frame.add_fcn (close_fcn, outfile);
+
   // qh_new_qhull command and points arguments are not const...
 
   std::string cmd = "qhull v" + options;
@@ -326,11 +324,11 @@
     warning ("%s: qhull did not free %d bytes of long memory (%d pieces)",
              caller.c_str (), totlong, curlong);
 
+  return retval;
+
 #else
   error ("%s: not available in this version of Octave", caller.c_str ());
 #endif
-
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/amd.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/amd.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -182,6 +182,7 @@
 
 #endif
 }
+
 /*
 %!shared A, A2, opts
 %! A = ones (20, 30);
--- a/libinterp/dldfcn/audiodevinfo.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/audiodevinfo.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -105,12 +105,13 @@
 recording using those parameters.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_PORTAUDIO
 
   int nargin = args.length ();
 
+  if (nargin > 5)
+    print_usage ();
+
   octave_scalar_map devinfo;
   octave_value_list input;
   octave_value_list output;
@@ -197,6 +198,8 @@
   devinfo.setfield ("input", inputdev);
   devinfo.setfield ("output", outputdev);
 
+  octave_value retval;
+
   // Return information about input and output audio devices and
   // their properties.
   if (nargin == 0)
@@ -403,15 +406,13 @@
 
       retval = 0;
     }
-  else
-    print_usage ();
+
+  return retval;
 
 #else
   NO_PORTAUDIO_MSG
   (void) args;  //silence compiler warning "unused parameter"
 #endif
-
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/audioread.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/audioread.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -70,8 +70,6 @@
 is stored in the audio file.\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
 #ifdef HAVE_SNDFILE
 
   int nargin = args.length ();
@@ -79,7 +77,7 @@
   if (nargin < 1 || nargin > 3)
     print_usage ();
 
-  std::string filename = args(0).string_value ();
+  std::string filename = args(0).xstring_value ("audioread: FILENAME must be a string");
 
   SF_INFO info;
   info.format = 0;
@@ -171,15 +169,11 @@
   else
     ret_audio = audio;
 
-  retval = ovl (ret_audio, info.samplerate);
+  return ovl (ret_audio, info.samplerate);
 
 #else
-
   error ("sndfile not found on your system and thus audioread is not functional");
-
 #endif
-
-  return retval;
 }
 
 #ifdef HAVE_SNDFILE
@@ -262,11 +256,6 @@
 @end table\n\
 @end deftypefn")
 {
-  // FIXME: shouldn't we return something to indicate whether the file
-  // was written successfully?
-
-  octave_value retval;
-
 #ifdef HAVE_SNDFILE
 
   int nargin = args.length ();
@@ -274,9 +263,7 @@
   if (nargin < 3)
     print_usage ();
 
-  std::string filename = args(0).string_value ();
-
-  Matrix audio = args(1).matrix_value ();
+  std::string filename = args(0).xstring_value ("audiowrite: FILENAME must be a string");
 
   double bias = 0.0;
   double scale = 1.0;
@@ -290,9 +277,11 @@
   else if (args(1).is_integer_type ())
     {
       gripe_wrong_type_arg ("audiowrite", args(1));
-      return retval;
+      return octave_value_list ();
     }
 
+  Matrix audio = args(1).matrix_value ();
+
   int samplerate = args(2).int_value ();
 
   std::string ext;
@@ -425,13 +414,15 @@
       offset += chunk_size;
     }
 
+  // FIXME: shouldn't we return something to indicate whether the file
+  // was written successfully?
+  return octave_value_list ();
+
 #else
 
   error ("sndfile not found on your system and thus audiowrite is not functional");
 
 #endif
-
-  return retval;
 }
 
 DEFUN_DLD (audioinfo, args, ,
@@ -440,14 +431,11 @@
 Return information about an audio file specified by @var{filename}.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_SNDFILE
-
   if (args.length () != 1)
     print_usage ();
 
-  std::string filename = args(0).string_value ();
+  std::string filename = args(0).xstring_value ("audioinfo: FILENAME must be a string");
 
   SF_INFO info;
   info.format = 0;
@@ -501,13 +489,11 @@
   result.assign ("Artist", sf_get_string (file, SF_STR_ARTIST));
   result.assign ("Comment", sf_get_string (file, SF_STR_COMMENT));
 
-  retval = result;
+  return ovl (result);
 
 #else
 
   error ("sndfile not found on your system and thus audioinfo is not functional");
 
 #endif
-
-  return retval;
 }
--- a/libinterp/dldfcn/chol.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/chol.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -337,11 +337,10 @@
 @seealso{chol, chol2inv, inv}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
   octave_value arg = args(0);
 
   octave_idx_type nr = arg.rows ();
@@ -466,11 +465,11 @@
 @seealso{chol, cholinv, inv}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   octave_value arg = args(0);
 
   octave_idx_type nr = arg.rows ();
@@ -612,7 +611,7 @@
           else
             fact.update (u);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
       else
         {
@@ -629,7 +628,7 @@
           else
             fact.update (u);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
     }
   else
@@ -648,7 +647,7 @@
           else
             fact.update (u);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
       else
         {
@@ -664,7 +663,7 @@
           else
             fact.update (u);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
     }
 
@@ -775,8 +774,6 @@
       || ! argj.is_real_scalar ())
     print_usage ();
 
-  octave_value_list retval (nargout == 2 ? 2 : 1);
-
   octave_idx_type n = argr.rows ();
   octave_idx_type j = argj.scalar_value ();
 
@@ -786,6 +783,8 @@
   if (j < 1 || j > n+1)
     error ("cholinsert: index J out of range");
 
+  octave_value_list retval (nargout == 2 ? 2 : 1);
+
   int err = 0;
   if (argr.is_single_type () || argu.is_single_type ())
     {
@@ -799,7 +798,7 @@
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
       else
         {
@@ -812,7 +811,7 @@
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
     }
   else
@@ -827,7 +826,7 @@
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
       else
         {
@@ -840,7 +839,7 @@
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
-          retval(0) = get_chol_r (fact);
+          retval = ovl (get_chol_r (fact));
         }
     }
 
@@ -1003,8 +1002,6 @@
 @seealso{chol, cholupdate, cholinsert, cholshift}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -1017,66 +1014,64 @@
   octave_idx_type n = argr.rows ();
   octave_idx_type j = argj.scalar_value ();
 
-  if (argr.columns () == n)
-    {
-      if (j > 0 && j <= n)
-        {
-          if (argr.is_single_type ())
-            {
-              if (argr.is_real_type ())
-                {
-                  // real case
-                  FloatMatrix R = argr.float_matrix_value ();
+  if (argr.columns () != n)
+    error ("choldelete: matrix R must be square");
 
-                  FloatCHOL fact;
-                  fact.set (R);
-                  fact.delete_sym (j-1);
+  if (j < 0 && j > n)
+    error ("choldelete: index J out of range");
 
-                  retval(0) = get_chol_r (fact);
-                }
-              else
-                {
-                  // complex case
-                  FloatComplexMatrix R = argr.float_complex_matrix_value ();
-
-                  FloatComplexCHOL fact;
-                  fact.set (R);
-                  fact.delete_sym (j-1);
+  octave_value_list retval;
 
-                  retval(0) = get_chol_r (fact);
-                }
-            }
-          else
-            {
-              if (argr.is_real_type ())
-                {
-                  // real case
-                  Matrix R = argr.matrix_value ();
-
-                  CHOL fact;
-                  fact.set (R);
-                  fact.delete_sym (j-1);
+  if (argr.is_single_type ())
+    {
+      if (argr.is_real_type ())
+        {
+          // real case
+          FloatMatrix R = argr.float_matrix_value ();
 
-                  retval(0) = get_chol_r (fact);
-                }
-              else
-                {
-                  // complex case
-                  ComplexMatrix R = argr.complex_matrix_value ();
+          FloatCHOL fact;
+          fact.set (R);
+          fact.delete_sym (j-1);
 
-                  ComplexCHOL fact;
-                  fact.set (R);
-                  fact.delete_sym (j-1);
-
-                  retval(0) = get_chol_r (fact);
-                }
-            }
+          retval = ovl (get_chol_r (fact));
         }
       else
-        error ("choldelete: index J out of range");
+        {
+          // complex case
+          FloatComplexMatrix R = argr.float_complex_matrix_value ();
+
+          FloatComplexCHOL fact;
+          fact.set (R);
+          fact.delete_sym (j-1);
+
+          retval = ovl (get_chol_r (fact));
+        }
     }
   else
-    error ("choldelete: matrix R must be square");
+    {
+      if (argr.is_real_type ())
+        {
+          // real case
+          Matrix R = argr.matrix_value ();
+
+          CHOL fact;
+          fact.set (R);
+          fact.delete_sym (j-1);
+
+          retval = ovl (get_chol_r (fact));
+        }
+      else
+        {
+          // complex case
+          ComplexMatrix R = argr.complex_matrix_value ();
+
+          ComplexCHOL fact;
+          fact.set (R);
+          fact.delete_sym (j-1);
+
+          retval = ovl (get_chol_r (fact));
+        }
+    }
 
   return retval;
 }
@@ -1133,8 +1128,6 @@
 @seealso{chol, cholupdate, cholinsert, choldelete}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 3)
     print_usage ();
 
@@ -1150,68 +1143,65 @@
   octave_idx_type i = argi.scalar_value ();
   octave_idx_type j = argj.scalar_value ();
 
-  if (argr.columns () == n)
-    {
-      if (j > 0 && j <= n+1 && i > 0 && i <= n+1)
-        {
-
-          if (argr.is_single_type () && argi.is_single_type ()
-              && argj.is_single_type ())
-            {
-              if (argr.is_real_type ())
-                {
-                  // real case
-                  FloatMatrix R = argr.float_matrix_value ();
+  if (argr.columns () != n)
+    error ("cholshift: R must be a square matrix");
 
-                  FloatCHOL fact;
-                  fact.set (R);
-                  fact.shift_sym (i-1, j-1);
+  if (j < 0 || j > n+1 || i < 0 || i > n+1)
+    error ("cholshift: index I or J is out of range");
 
-                  retval(0) = get_chol_r (fact);
-                }
-              else
-                {
-                  // complex case
-                  FloatComplexMatrix R = argr.float_complex_matrix_value ();
-
-                  FloatComplexCHOL fact;
-                  fact.set (R);
-                  fact.shift_sym (i-1, j-1);
+  octave_value_list retval;
 
-                  retval(0) = get_chol_r (fact);
-                }
-            }
-          else
-            {
-              if (argr.is_real_type ())
-                {
-                  // real case
-                  Matrix R = argr.matrix_value ();
-
-                  CHOL fact;
-                  fact.set (R);
-                  fact.shift_sym (i-1, j-1);
+  if (argr.is_single_type () && argi.is_single_type ()
+      && argj.is_single_type ())
+    {
+      if (argr.is_real_type ())
+        {
+          // real case
+          FloatMatrix R = argr.float_matrix_value ();
 
-                  retval(0) = get_chol_r (fact);
-                }
-              else
-                {
-                  // complex case
-                  ComplexMatrix R = argr.complex_matrix_value ();
+          FloatCHOL fact;
+          fact.set (R);
+          fact.shift_sym (i-1, j-1);
 
-                  ComplexCHOL fact;
-                  fact.set (R);
-                  fact.shift_sym (i-1, j-1);
-
-                  retval(0) = get_chol_r (fact);
-                }
-            }
+          retval = ovl (get_chol_r (fact));
         }
       else
-        error ("cholshift: index I or J is out of range");
+        {
+          // complex case
+          FloatComplexMatrix R = argr.float_complex_matrix_value ();
+
+          FloatComplexCHOL fact;
+          fact.set (R);
+          fact.shift_sym (i-1, j-1);
+
+          retval = ovl (get_chol_r (fact));
+        }
     }
   else
-    error ("cholshift: R must be a square matrix");
+    {
+      if (argr.is_real_type ())
+        {
+          // real case
+          Matrix R = argr.matrix_value ();
+
+          CHOL fact;
+          fact.set (R);
+          fact.shift_sym (i-1, j-1);
+
+          retval = ovl (get_chol_r (fact));
+        }
+      else
+        {
+          // complex case
+          ComplexMatrix R = argr.complex_matrix_value ();
+
+          ComplexCHOL fact;
+          fact.set (R);
+          fact.shift_sym (i-1, j-1);
+
+          retval = ovl (get_chol_r (fact));
+        }
+    }
 
   return retval;
 }
--- a/libinterp/dldfcn/colamd.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/colamd.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -668,29 +668,26 @@
   octave_idx_type *cidx = 0;
 
   if (args(0).is_sparse_type ())
-    {
-      if (args(0).is_complex_type ())
-        {
-          SparseComplexMatrix scm = args(0).sparse_complex_matrix_value ();
+    error ("etree: S must be a sparse matrix");
 
-          n_row = scm.rows ();
-          n_col = scm.cols ();
-          ridx = scm.xridx ();
-          cidx = scm.xcidx ();
-        }
-      else
-        {
-          SparseMatrix sm = args(0).sparse_matrix_value ();
+  if (args(0).is_complex_type ())
+    {
+      SparseComplexMatrix scm = args(0).sparse_complex_matrix_value ();
 
-          n_row = sm.rows ();
-          n_col = sm.cols ();
-          ridx = sm.xridx ();
-          cidx = sm.xcidx ();
-        }
-
+      n_row = scm.rows ();
+      n_col = scm.cols ();
+      ridx = scm.xridx ();
+      cidx = scm.xcidx ();
     }
   else
-    error ("etree: S must be a sparse matrix");
+    {
+      SparseMatrix sm = args(0).sparse_matrix_value ();
+
+      n_row = sm.rows ();
+      n_col = sm.cols ();
+      ridx = sm.xridx ();
+      cidx = sm.xcidx ();
+    }
 
   bool is_sym = true;
 
--- a/libinterp/dldfcn/dmperm.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/dmperm.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -149,18 +149,16 @@
 @seealso{colamd, ccolamd}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
+#if HAVE_CXSPARSE
 
   if (args.length () != 1)
     print_usage ();
 
-#if HAVE_CXSPARSE
-  retval = dmperm_internal (false, args(0), nargout);
+  return ovl (dmperm_internal (false, args(0), nargout));
+
 #else
   error ("dmperm: not available in this version of Octave");
 #endif
-
-  return retval;
 }
 
 /*
@@ -194,18 +192,16 @@
 @seealso{dmperm}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
+#if HAVE_CXSPARSE
 
   if (args.length () != 1)
     print_usage ();
 
-#if HAVE_CXSPARSE
-  retval = dmperm_internal (true, args(0), nargout);
+  return ovl (dmperm_internal (true, args(0), nargout));
+
 #else
   error ("sprank: not available in this version of Octave");
 #endif
-
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/fftw.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/fftw.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -132,19 +132,20 @@
 @seealso{fft, ifft, fft2, ifft2, fftn, ifftn}\n\
 @end deftypefn")
 {
-  octave_value retval;
+#if defined (HAVE_FFTW)
 
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
-#if defined (HAVE_FFTW)
+  octave_value retval;
+
   std::string arg0 = args(0).xstring_value ("fftw: first argument must be a string");
 
   if (arg0 == "planner")
     {
-      if (nargin == 2)  //planner setter
+      if (nargin == 2)  // planner setter
         {
           // Use STL function to convert to lower case
           std::transform (arg0.begin (), arg0.end (), arg0.begin (), tolower);
@@ -235,8 +236,7 @@
 
           retval = octave_value (std::string (str));
 
-          // FIXME: need to free string even if there is an
-          // exception.
+          // FIXME: need to free string even if there is an exception.
           free (str);
         }
       else //dwisdom getter
@@ -244,8 +244,7 @@
           char *str = fftw_export_wisdom_to_string ();
           retval = octave_value (std::string (str));
 
-          // FIXME: need to free string even if there is an
-          // exception.
+          // FIXME: need to free string even if there is an exception.
           free (str);
         }
     }
@@ -269,8 +268,7 @@
 
           retval = octave_value (std::string (str));
 
-          // FIXME: need to free string even if there is an
-          // exception.
+          // FIXME: need to free string even if there is an exception.
           free (str);
         }
       else //swisdom getter
@@ -278,8 +276,7 @@
           char *str = fftwf_export_wisdom_to_string ();
           retval = octave_value (std::string (str));
 
-          // FIXME: need to free string even if there is an
-          // exception.
+          // FIXME: need to free string even if there is an exception.
           free (str);
         }
     }
@@ -287,27 +284,23 @@
     {
       if (nargin == 2)  //threads setter
         {
-          if (args(1).is_real_scalar ())
-            {
-              int nthreads = args(1).int_value();
-              if (nthreads >= 1)
-                {
+          if (! args(1).is_real_scalar ())
+            error ("fftw: setting threads needs one integer argument");
+
+          int nthreads = args(1).int_value();
+          if (nthreads < 1)
+            error ("fftw: number of threads must be >=1");
+
 #if defined (HAVE_FFTW3_THREADS)
-                  octave_fftw_planner::threads (nthreads);
+          octave_fftw_planner::threads (nthreads);
 #else
-                  gripe_disabled_feature ("fftw", "multithreaded FFTW");
+          gripe_disabled_feature ("fftw", "multithreaded FFTW");
 #endif
 #if defined (HAVE_FFTW3F_THREADS)
-                  octave_float_fftw_planner::threads (nthreads);
+          octave_float_fftw_planner::threads (nthreads);
 #else
-                  gripe_disabled_feature ("fftw", "multithreaded FFTW");
+          gripe_disabled_feature ("fftw", "multithreaded FFTW");
 #endif
-                }
-              else
-                error ("fftw: number of threads must be >=1");
-            }
-          else
-            error ("fftw: setting threads needs one integer argument");
         }
       else //threads getter
 #if defined (HAVE_FFTW3_THREADS)
@@ -318,13 +311,14 @@
     }
   else
     error ("fftw: unrecognized argument");
+
+  return retval;
+
 #else
 
   gripe_disabled_feature ("fftw", "the FFTW3 planner");
 
 #endif
-
-  return retval;
 }
 
 /*
--- a/libinterp/dldfcn/qr.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/qr.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -749,76 +749,68 @@
       || ! argu.is_numeric_type () || ! argv.is_numeric_type ())
     print_usage ();
 
-  if (check_qr_dims (argq, argr, true))
-    {
-      if (argq.is_real_type ()
-          && argr.is_real_type ()
-          && argu.is_real_type ()
-          && argv.is_real_type ())
-        {
-          // all real case
-          if (argq.is_single_type ()
-              || argr.is_single_type ()
-              || argu.is_single_type ()
-              || argv.is_single_type ())
-            {
-              FloatMatrix Q = argq.float_matrix_value ();
-              FloatMatrix R = argr.float_matrix_value ();
-              FloatMatrix u = argu.float_matrix_value ();
-              FloatMatrix v = argv.float_matrix_value ();
+  if (! check_qr_dims (argq, argr, true))
+    error ("qrupdate: Q and R dimensions don't match");
 
-              FloatQR fact (Q, R);
-              fact.update (u, v);
+  if (argq.is_real_type () && argr.is_real_type () && argu.is_real_type ()
+      && argv.is_real_type ())
+    {
+      // all real case
+      if (argq.is_single_type () || argr.is_single_type ()
+          || argu.is_single_type () || argv.is_single_type ())
+        {
+          FloatMatrix Q = argq.float_matrix_value ();
+          FloatMatrix R = argr.float_matrix_value ();
+          FloatMatrix u = argu.float_matrix_value ();
+          FloatMatrix v = argv.float_matrix_value ();
 
-              retval = ovl (fact.Q (), get_qr_r (fact));
-            }
-          else
-            {
-              Matrix Q = argq.matrix_value ();
-              Matrix R = argr.matrix_value ();
-              Matrix u = argu.matrix_value ();
-              Matrix v = argv.matrix_value ();
+          FloatQR fact (Q, R);
+          fact.update (u, v);
 
-              QR fact (Q, R);
-              fact.update (u, v);
-
-              retval = ovl (fact.Q (), get_qr_r (fact));
-            }
+          retval = ovl (fact.Q (), get_qr_r (fact));
         }
       else
         {
-          // complex case
-          if (argq.is_single_type ()
-              || argr.is_single_type ()
-              || argu.is_single_type ()
-              || argv.is_single_type ())
-            {
-              FloatComplexMatrix Q = argq.float_complex_matrix_value ();
-              FloatComplexMatrix R = argr.float_complex_matrix_value ();
-              FloatComplexMatrix u = argu.float_complex_matrix_value ();
-              FloatComplexMatrix v = argv.float_complex_matrix_value ();
-
-              FloatComplexQR fact (Q, R);
-              fact.update (u, v);
+          Matrix Q = argq.matrix_value ();
+          Matrix R = argr.matrix_value ();
+          Matrix u = argu.matrix_value ();
+          Matrix v = argv.matrix_value ();
 
-              retval = ovl (fact.Q (), get_qr_r (fact));
-            }
-          else
-            {
-              ComplexMatrix Q = argq.complex_matrix_value ();
-              ComplexMatrix R = argr.complex_matrix_value ();
-              ComplexMatrix u = argu.complex_matrix_value ();
-              ComplexMatrix v = argv.complex_matrix_value ();
+          QR fact (Q, R);
+          fact.update (u, v);
 
-              ComplexQR fact (Q, R);
-              fact.update (u, v);
-
-              retval = ovl (fact.Q (), get_qr_r (fact));
-            }
+          retval = ovl (fact.Q (), get_qr_r (fact));
         }
     }
   else
-    error ("qrupdate: Q and R dimensions don't match");
+    {
+      // complex case
+      if (argq.is_single_type () || argr.is_single_type ()
+          || argu.is_single_type () || argv.is_single_type ())
+        {
+          FloatComplexMatrix Q = argq.float_complex_matrix_value ();
+          FloatComplexMatrix R = argr.float_complex_matrix_value ();
+          FloatComplexMatrix u = argu.float_complex_matrix_value ();
+          FloatComplexMatrix v = argv.float_complex_matrix_value ();
+
+          FloatComplexQR fact (Q, R);
+          fact.update (u, v);
+
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+      else
+        {
+          ComplexMatrix Q = argq.complex_matrix_value ();
+          ComplexMatrix R = argr.complex_matrix_value ();
+          ComplexMatrix u = argu.complex_matrix_value ();
+          ComplexMatrix v = argv.complex_matrix_value ();
+
+          ComplexQR fact (Q, R);
+          fact.update (u, v);
+
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+    }
 
   return retval;
 }
@@ -913,8 +905,6 @@
 @seealso{qr, qrupdate, qrdelete, qrshift}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   int nargin = args.length ();
 
   if (nargin < 4 || nargin > 5)
@@ -931,107 +921,96 @@
     print_usage ();
 
   std::string orient = (nargin < 5) ? "col" : args(4).string_value ();
+  bool col = (orient == "col");
 
-  bool col = orient == "col";
+  if (! col && orient != "row")
+    error ("qrinsert: ORIENT must be \"col\" or \"row\"");
+
+  if (! check_qr_dims (argq, argr, col) || (! col && argx.rows () != 1))
+    error ("qrinsert: dimension mismatch");
 
-  if (col || orient == "row")
-    if (check_qr_dims (argq, argr, col)
-        && (col || argx.rows () == 1))
-      {
-        if (check_index (argj, col))
-          {
-            MArray<octave_idx_type> j
-              = argj.octave_idx_type_vector_value ();
+  if (! check_index (argj, col))
+    error ("qrinsert: invalid index J");
 
-            octave_idx_type one = 1;
+  octave_value_list retval;
+
+  MArray<octave_idx_type> j = argj.octave_idx_type_vector_value ();
+
+  octave_idx_type one = 1;
 
-            if (argq.is_real_type ()
-                && argr.is_real_type ()
-                && argx.is_real_type ())
-              {
-                // real case
-                if (argq.is_single_type ()
-                    || argr.is_single_type ()
-                    || argx.is_single_type ())
-                  {
-                    FloatMatrix Q = argq.float_matrix_value ();
-                    FloatMatrix R = argr.float_matrix_value ();
-                    FloatMatrix x = argx.float_matrix_value ();
+  if (argq.is_real_type () && argr.is_real_type () && argx.is_real_type ())
+    {
+      // real case
+      if (argq.is_single_type () || argr.is_single_type ()
+          || argx.is_single_type ())
+        {
+          FloatMatrix Q = argq.float_matrix_value ();
+          FloatMatrix R = argr.float_matrix_value ();
+          FloatMatrix x = argx.float_matrix_value ();
 
-                    FloatQR fact (Q, R);
+          FloatQR fact (Q, R);
 
-                    if (col)
-                      fact.insert_col (x, j-one);
-                    else
-                      fact.insert_row (x.row (0), j(0)-one);
+          if (col)
+            fact.insert_col (x, j-one);
+          else
+            fact.insert_row (x.row (0), j(0)-one);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-                else
-                  {
-                    Matrix Q = argq.matrix_value ();
-                    Matrix R = argr.matrix_value ();
-                    Matrix x = argx.matrix_value ();
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+      else
+        {
+          Matrix Q = argq.matrix_value ();
+          Matrix R = argr.matrix_value ();
+          Matrix x = argx.matrix_value ();
 
-                    QR fact (Q, R);
-
-                    if (col)
-                      fact.insert_col (x, j-one);
-                    else
-                      fact.insert_row (x.row (0), j(0)-one);
+          QR fact (Q, R);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-              }
-            else
-              {
-                // complex case
-                if (argq.is_single_type ()
-                    || argr.is_single_type ()
-                    || argx.is_single_type ())
-                  {
-                    FloatComplexMatrix Q =
-                      argq.float_complex_matrix_value ();
-                    FloatComplexMatrix R =
-                      argr.float_complex_matrix_value ();
-                    FloatComplexMatrix x =
-                      argx.float_complex_matrix_value ();
+          if (col)
+            fact.insert_col (x, j-one);
+          else
+            fact.insert_row (x.row (0), j(0)-one);
 
-                    FloatComplexQR fact (Q, R);
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+    }
+  else
+    {
+      // complex case
+      if (argq.is_single_type () || argr.is_single_type ()
+          || argx.is_single_type ())
+        {
+          FloatComplexMatrix Q =
+            argq.float_complex_matrix_value ();
+          FloatComplexMatrix R =
+            argr.float_complex_matrix_value ();
+          FloatComplexMatrix x =
+            argx.float_complex_matrix_value ();
 
-                    if (col)
-                      fact.insert_col (x, j-one);
-                    else
-                      fact.insert_row (x.row (0), j(0)-one);
+          FloatComplexQR fact (Q, R);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-                else
-                  {
-                    ComplexMatrix Q = argq.complex_matrix_value ();
-                    ComplexMatrix R = argr.complex_matrix_value ();
-                    ComplexMatrix x = argx.complex_matrix_value ();
-
-                    ComplexQR fact (Q, R);
+          if (col)
+            fact.insert_col (x, j-one);
+          else
+            fact.insert_row (x.row (0), j(0)-one);
 
-                    if (col)
-                      fact.insert_col (x, j-one);
-                    else
-                      fact.insert_row (x.row (0), j(0)-one);
-
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-              }
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+      else
+        {
+          ComplexMatrix Q = argq.complex_matrix_value ();
+          ComplexMatrix R = argr.complex_matrix_value ();
+          ComplexMatrix x = argx.complex_matrix_value ();
 
-          }
-        else
-          error ("qrinsert: invalid index J");
-      }
-    else
-      error ("qrinsert: dimension mismatch");
+          ComplexQR fact (Q, R);
 
-  else
-    error ("qrinsert: ORIENT must be \"col\" or \"row\"");
+          if (col)
+            fact.insert_col (x, j-one);
+          else
+            fact.insert_row (x.row (0), j(0)-one);
+
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+    }
 
   return retval;
 }
@@ -1122,7 +1101,6 @@
 @seealso{qr, qrupdate, qrinsert, qrshift}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
   int nargin = args.length ();
 
   if (nargin < 3 || nargin > 4)
@@ -1137,97 +1115,88 @@
     print_usage ();
 
   std::string orient = (nargin < 4) ? "col" : args(3).string_value ();
-
   bool col = orient == "col";
 
-  if (col || orient == "row")
-    if (check_qr_dims (argq, argr, col))
-      {
-        if (check_index (argj, col))
-          {
-            MArray<octave_idx_type> j
-              = argj.octave_idx_type_vector_value ();
+  if (! col && orient != "row")
+    error ("qrdelete: ORIENT must be \"col\" or \"row\"");
 
-            octave_idx_type one = 1;
+  if (! check_qr_dims (argq, argr, col))
+    error ("qrdelete: dimension mismatch");
 
-            if (argq.is_real_type ()
-                && argr.is_real_type ())
-              {
-                // real case
-                if (argq.is_single_type ()
-                    || argr.is_single_type ())
-                  {
-                    FloatMatrix Q = argq.float_matrix_value ();
-                    FloatMatrix R = argr.float_matrix_value ();
+  MArray<octave_idx_type> j = argj.octave_idx_type_vector_value ();
+  if (! check_index (argj, col))
+    error ("qrdelete: invalid index J");
+
+  octave_value_list retval;
+
+  octave_idx_type one = 1;
 
-                    FloatQR fact (Q, R);
+  if (argq.is_real_type () && argr.is_real_type ())
+    {
+      // real case
+      if (argq.is_single_type () || argr.is_single_type ())
+        {
+          FloatMatrix Q = argq.float_matrix_value ();
+          FloatMatrix R = argr.float_matrix_value ();
 
-                    if (col)
-                      fact.delete_col (j-one);
-                    else
-                      fact.delete_row (j(0)-one);
+          FloatQR fact (Q, R);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-                else
-                  {
-                    Matrix Q = argq.matrix_value ();
-                    Matrix R = argr.matrix_value ();
+          if (col)
+            fact.delete_col (j-one);
+          else
+            fact.delete_row (j(0)-one);
 
-                    QR fact (Q, R);
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+      else
+        {
+          Matrix Q = argq.matrix_value ();
+          Matrix R = argr.matrix_value ();
 
-                    if (col)
-                      fact.delete_col (j-one);
-                    else
-                      fact.delete_row (j(0)-one);
+          QR fact (Q, R);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-              }
-            else
-              {
-                // complex case
-                if (argq.is_single_type ()
-                    || argr.is_single_type ())
-                  {
-                    FloatComplexMatrix Q =
-                      argq.float_complex_matrix_value ();
-                    FloatComplexMatrix R =
-                      argr.float_complex_matrix_value ();
+          if (col)
+            fact.delete_col (j-one);
+          else
+            fact.delete_row (j(0)-one);
 
-                    FloatComplexQR fact (Q, R);
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+    }
+  else
+    {
+      // complex case
+      if (argq.is_single_type () || argr.is_single_type ())
+        {
+          FloatComplexMatrix Q =
+            argq.float_complex_matrix_value ();
+          FloatComplexMatrix R =
+            argr.float_complex_matrix_value ();
 
-                    if (col)
-                      fact.delete_col (j-one);
-                    else
-                      fact.delete_row (j(0)-one);
+          FloatComplexQR fact (Q, R);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-                else
-                  {
-                    ComplexMatrix Q = argq.complex_matrix_value ();
-                    ComplexMatrix R = argr.complex_matrix_value ();
-
-                    ComplexQR fact (Q, R);
+          if (col)
+            fact.delete_col (j-one);
+          else
+            fact.delete_row (j(0)-one);
 
-                    if (col)
-                      fact.delete_col (j-one);
-                    else
-                      fact.delete_row (j(0)-one);
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+      else
+        {
+          ComplexMatrix Q = argq.complex_matrix_value ();
+          ComplexMatrix R = argr.complex_matrix_value ();
+
+          ComplexQR fact (Q, R);
 
-                    retval = ovl (fact.Q (), get_qr_r (fact));
-                  }
-              }
-          }
-        else
-          error ("qrdelete: invalid index J");
-      }
-    else
-      error ("qrdelete: dimension mismatch");
+          if (col)
+            fact.delete_col (j-one);
+          else
+            fact.delete_row (j(0)-one);
 
-  else
-    error ("qrdelete: ORIENT must be \"col\" or \"row\"");
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+    }
 
   return retval;
 }
@@ -1365,8 +1334,6 @@
 @seealso{qr, qrupdate, qrinsert, qrdelete}\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
   if (args.length () != 4)
     print_usage ();
 
@@ -1378,70 +1345,67 @@
   if (! argq.is_numeric_type () || ! argr.is_numeric_type ())
     print_usage ();
 
-  if (check_qr_dims (argq, argr, true))
-    {
-      if (check_index (argi) && check_index (argj))
-        {
-          octave_idx_type i = argi.int_value ();
-          octave_idx_type j = argj.int_value ();
+  if (! check_qr_dims (argq, argr, true))
+    error ("qrshift: dimensions mismatch");
 
-          if (argq.is_real_type ()
-              && argr.is_real_type ())
-            {
-              // all real case
-              if (argq.is_single_type ()
-                  && argr.is_single_type ())
-                {
-                  FloatMatrix Q = argq.float_matrix_value ();
-                  FloatMatrix R = argr.float_matrix_value ();
+  octave_idx_type i = argi.int_value ();
+  octave_idx_type j = argj.int_value ();
 
-                  FloatQR fact (Q, R);
-                  fact.shift_cols (i-1, j-1);
+  if (! check_index (argi) || ! check_index (argj))
+    error ("qrshift: invalid index I or J");
 
-                  retval = ovl (fact.Q (), get_qr_r (fact));
-                }
-              else
-                {
-                  Matrix Q = argq.matrix_value ();
-                  Matrix R = argr.matrix_value ();
+  octave_value_list retval;
 
-                  QR fact (Q, R);
-                  fact.shift_cols (i-1, j-1);
-
-                  retval = ovl (fact.Q (), get_qr_r (fact));
-                }
-            }
-          else
-            {
-              // complex case
-              if (argq.is_single_type ()
-                  && argr.is_single_type ())
-                {
-                  FloatComplexMatrix Q = argq.float_complex_matrix_value ();
-                  FloatComplexMatrix R = argr.float_complex_matrix_value ();
+  if (argq.is_real_type () && argr.is_real_type ())
+    {
+      // all real case
+      if (argq.is_single_type ()
+          && argr.is_single_type ())
+        {
+          FloatMatrix Q = argq.float_matrix_value ();
+          FloatMatrix R = argr.float_matrix_value ();
 
-                  FloatComplexQR fact (Q, R);
-                  fact.shift_cols (i-1, j-1);
+          FloatQR fact (Q, R);
+          fact.shift_cols (i-1, j-1);
 
-                  retval = ovl (fact.Q (), get_qr_r (fact));
-                }
-              else
-                {
-                  ComplexMatrix Q = argq.complex_matrix_value ();
-                  ComplexMatrix R = argr.complex_matrix_value ();
-
-                  ComplexQR fact (Q, R);
-                  fact.shift_cols (i-1, j-1);
-
-                  retval = ovl (fact.Q (), get_qr_r (fact));
-                }
-            }
+          retval = ovl (fact.Q (), get_qr_r (fact));
         }
       else
-        error ("qrshift: invalid index I or J");
+        {
+          Matrix Q = argq.matrix_value ();
+          Matrix R = argr.matrix_value ();
+
+          QR fact (Q, R);
+          fact.shift_cols (i-1, j-1);
+
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
     }
   else
-    error ("qrshift: dimensions mismatch");
+    {
+      // complex case
+      if (argq.is_single_type ()
+          && argr.is_single_type ())
+        {
+          FloatComplexMatrix Q = argq.float_complex_matrix_value ();
+          FloatComplexMatrix R = argr.float_complex_matrix_value ();
+
+          FloatComplexQR fact (Q, R);
+          fact.shift_cols (i-1, j-1);
+
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+      else
+        {
+          ComplexMatrix Q = argq.complex_matrix_value ();
+          ComplexMatrix R = argr.complex_matrix_value ();
+
+          ComplexQR fact (Q, R);
+          fact.shift_cols (i-1, j-1);
+
+          retval = ovl (fact.Q (), get_qr_r (fact));
+        }
+    }
 
   return retval;
 }
--- a/libinterp/dldfcn/symbfact.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/symbfact.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -342,9 +342,9 @@
     tmp(i) = ColCount[i];
   retval(0) = tmp;
 
+  return retval;
+
 #else
   error ("symbfact: not available in this version of Octave");
 #endif
-
-  return retval;
 }
--- a/libinterp/dldfcn/symrcm.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/dldfcn/symrcm.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -437,11 +437,11 @@
 @seealso{colperm, colamd, symamd}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   octave_value arg = args(0);
 
   // the parameter of the matrix is converted into a sparse matrix
@@ -475,7 +475,7 @@
     }
 
   if (nr == 0 && nc == 0)
-    return octave_value (NDArray (dim_vector (1, 0)));
+    return ovl (NDArray (dim_vector (1, 0)));
 
   // sizes of the heaps
   octave_idx_type s = 0;
@@ -504,7 +504,8 @@
     {
       for (octave_idx_type i = 0; i < N; i++)
         P(i) = i;
-      return octave_value (P);
+
+      return ovl (P);
     }
 
   // a heap for the a node's neighbors. The number of neighbors is
@@ -693,5 +694,5 @@
     std::swap (P.elem (i), P.elem (j));
 
   // increment all indices, since Octave is not C
-  return octave_value (P+1);
+  return ovl (P+1);
 }
--- a/libinterp/octave-value/ov-bool-mat.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-bool-mat.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -570,11 +570,11 @@
 @seealso{double, single, char}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   octave_value arg = args(0);
 
   if (arg.is_bool_type ())
--- a/libinterp/octave-value/ov-cell.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-cell.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1201,7 +1201,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_cell ());
+  return ovl (args(0).is_cell ());
 }
 
 DEFUN (cell, args, ,
@@ -1266,7 +1266,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_cellstr ());
+  return ovl (args(0).is_cellstr ());
 }
 
 // Note that since Fcellstr calls Fiscellstr, we need to have
@@ -1287,25 +1287,22 @@
 @seealso{cell, char}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
+  octave_value retval;
+
   octave_value_list tmp = Fiscellstr (args, 1);
 
   if (tmp(0).is_true ())
-    retval = args(0);
+    return ovl (args(0));
   else
     {
       string_vector s = args(0).xall_strings ("cellstr: argument STRING must be a 2-D character array");
 
-      retval = (s.is_empty ()
-                ? Cell (octave_value (std::string ()))
-                : Cell (s, true));
+      return ovl (s.is_empty () ? Cell (octave_value (std::string ()))
+                                : Cell (s, true));
     }
-
-  return retval;
 }
 
 DEFUN (struct2cell, args, ,
@@ -1371,13 +1368,13 @@
 
   octave_idx_type n_elts = m.numel ();
 
-  // Fill c in one sweep. Note that thanks to octave_map structure,
+  // Fill c in one sweep.  Note that thanks to octave_map structure,
   // we don't need a key lookup at all.
   for (octave_idx_type j = 0; j < n_elts; j++)
     for (octave_idx_type i = 0; i < num_fields; i++)
       c(i,j) = m.contents(i)(j);
 
-  return octave_value (c);
+  return ovl (c);
 }
 
 /*
--- a/libinterp/octave-value/ov-class.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-class.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1739,57 +1739,50 @@
 @seealso{typeinfo, isa}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin == 0)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 1)
     // Called for class of object
     retval = args(0).class_name ();
   else
     {
       // Called as class constructor
-      octave_function *fcn = octave_call_stack::caller ();
-
       std::string id = args(1).xstring_value ("class: ID (class name) must be a string");
 
-      if (fcn)
-        {
-          if (fcn->is_class_constructor (id) || fcn->is_class_method (id))
-            {
-              octave_map m = args(0).xmap_value ("class: S must be a valid structure");
+      octave_function *fcn = octave_call_stack::caller ();
+
+      if (! fcn)
+        error ("class: invalid call from outside class constructor or method");
 
-              if (nargin == 2)
-                retval
-                  = octave_value (new octave_class
-                                  (m, id, std::list<std::string> ()));
-              else
-                {
-                  octave_value_list parents = args.slice (2, nargin-2);
+      if (! fcn->is_class_constructor (id) && ! fcn->is_class_method (id))
+        error ("class: '%s' is invalid as a class name in this context",
+               id.c_str ());
+
+      octave_map m = args(0).xmap_value ("class: S must be a valid structure");
 
-                  retval
-                    = octave_value (new octave_class (m, id, parents));
-                }
-
-              octave_class::exemplar_const_iterator it
-                = octave_class::exemplar_map.find (id);
+      if (nargin == 2)
+        retval
+          = octave_value (new octave_class (m, id, std::list<std::string> ()));
+      else
+        {
+          octave_value_list parents = args.slice (2, nargin-2);
 
-              if (it == octave_class::exemplar_map.end ())
-                octave_class::exemplar_map[id]
-                  = octave_class::exemplar_info (retval);
-              else if (! it->second.compare (retval))
-                error ("class: object of class '%s' does not match previously constructed objects",
-                       id.c_str ());
-            }
-          else
-            error ("class: '%s' is invalid as a class name in this context",
-                   id.c_str ());
+          retval = octave_value (new octave_class (m, id, parents));
         }
-      else
-        error ("class: invalid call from outside class constructor or method");
+
+      octave_class::exemplar_const_iterator it
+        = octave_class::exemplar_map.find (id);
+
+      if (it == octave_class::exemplar_map.end ())
+        octave_class::exemplar_map[id] = octave_class::exemplar_info (retval);
+      else if (! it->second.compare (retval))
+        error ("class: object of class '%s' does not match previously constructed objects",
+               id.c_str ());
     }
 
   return retval;
@@ -1833,8 +1826,6 @@
 @seealso{class, typeinfo}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -1843,6 +1834,7 @@
   Array<std::string> clsnames = args(1).xcellstr_value ("isa: CLASSNAME must be a string or cell array of strings");
 
   boolNDArray matches (clsnames.dims (), false);
+
   for (octave_idx_type idx = 0; idx < clsnames.numel (); idx++)
     {
       std::string cls = clsnames(idx);
@@ -1853,7 +1845,8 @@
           || obj.is_instance_of (cls))
         matches(idx) = true;
     }
-  return octave_value (matches);
+
+  return ovl (matches);
 }
 
 /*
@@ -1922,17 +1915,15 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval = Cell ();
-
   if (args.length () != 1)
     print_usage ();
 
   octave_value arg = args(0);
 
   if (arg.is_object ())
-    retval = Cell (arg.parent_class_names ());
-
-  return retval;
+    return ovl (Cell (arg.parent_class_names ()));
+  else
+    return ovl (Cell ());
 }
 
 DEFUN (isobject, args, ,
@@ -1945,7 +1936,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_object ());
+  return ovl (args(0).is_object ());
 }
 
 DEFUN (ismethod, args, ,
@@ -1957,8 +1948,6 @@
 @seealso{isprop, isobject}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -1976,11 +1965,9 @@
   std::string method = args(1).string_value ();
 
   if (load_path::find_method (class_name, method) != std::string ())
-    retval = true;
+    return ovl (true);
   else
-    retval = false;
-
-  return retval;
+    return ovl (false);
 }
 
 DEFUN (__methods__, args, ,
@@ -1993,8 +1980,6 @@
 @seealso{methods}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   // Input validation has already been done in methods.m.
   octave_value arg = args(0);
 
@@ -2006,9 +1991,8 @@
     class_name = arg.string_value ();
 
   string_vector sv = load_path::methods (class_name);
-  retval = Cell (sv);
 
-  return retval;
+  return ovl (Cell (sv));
 }
 
 static bool
@@ -2050,7 +2034,7 @@
 @end deftypefn")
 {
   octave_function *fcn = octave_call_stack::caller ();
-  if ((! fcn) || (! fcn->is_class_constructor ()))
+  if (! fcn || ! fcn->is_class_constructor ())
     error ("superiorto: invalid call from outside class constructor");
 
   for (int i = 0; i < args.length (); i++)
@@ -2083,7 +2067,7 @@
 @end deftypefn")
 {
   octave_function *fcn = octave_call_stack::caller ();
-  if ((! fcn) || (! fcn->is_class_constructor ()))
+  if (! fcn || ! fcn->is_class_constructor ())
     error ("inferiorto: invalid call from outside class constructor");
 
   for (int i = 0; i < args.length (); i++)
--- a/libinterp/octave-value/ov-classdef.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-classdef.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -3806,8 +3806,6 @@
 
 DEFUN (__meta_get_package__, args, , "")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -3831,8 +3829,6 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #if DEBUG_TRACE
   std::cerr << "__meta_class_query__ ("
             << args(0).string_value () << ")"
@@ -3853,8 +3849,6 @@
 Returns the meta.class object corresponding to the class of @var{obj}.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
--- a/libinterp/octave-value/ov-fcn-handle.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-fcn-handle.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1723,79 +1723,75 @@
 
   octave_function *fcn = fh ? fh->function_value () : 0;
 
-  if (fcn)
-    {
-      octave_scalar_map m;
-
-      std::string fh_nm = fh->fcn_name ();
-
-      if (fh_nm == octave_fcn_handle::anonymous)
-        {
-          std::ostringstream buf;
-          fh->print_raw (buf);
-          m.setfield ("function", buf.str ());
+  if (! fcn)
+    error ("functions: FCN_HANDLE is not a valid function handle object");
 
-          m.setfield ("type", "anonymous");
-        }
-      else
-        {
-          m.setfield ("function", fh_nm);
+  octave_scalar_map m;
 
-          if (fcn->is_subfunction ())
-            {
-              m.setfield ("type", "subfunction");
-              Cell parentage (dim_vector (1, 2));
-              parentage.elem (0) = fh_nm;
-              parentage.elem (1) = fcn->parent_fcn_name ();
-              m.setfield ("parentage", octave_value (parentage));
-            }
-          else if (fcn->is_private_function ())
-            m.setfield ("type", "private");
-          else if (fh->is_overloaded ())
-            m.setfield ("type", "overloaded");
-          else
-            m.setfield ("type", "simple");
-        }
+  std::string fh_nm = fh->fcn_name ();
 
-      std::string nm = fcn->fcn_file_name ();
-
-      if (fh_nm == octave_fcn_handle::anonymous)
-        {
-          m.setfield ("file", nm);
-
-          octave_user_function *fu = fh->user_function_value ();
-
-          std::list<symbol_table::symbol_record> vars
-            = symbol_table::all_variables (fu->scope (), 0);
-
-          size_t varlen = vars.size ();
+  if (fh_nm == octave_fcn_handle::anonymous)
+    {
+      std::ostringstream buf;
+      fh->print_raw (buf);
+      m.setfield ("function", buf.str ());
 
-          if (varlen > 0)
-            {
-              octave_scalar_map ws;
-              for (std::list<symbol_table::symbol_record>::const_iterator
-                     p = vars.begin (); p != vars.end (); p++)
-                {
-                  ws.assign (p->name (), p->varval (0));
-                }
-
-              m.setfield ("workspace", ws);
-            }
-        }
-      else if (fcn->is_user_function () || fcn->is_user_script ())
-        {
-          octave_function *fu = fh->function_value ();
-          m.setfield ("file", fu->fcn_file_name ());
-        }
-      else
-        m.setfield ("file", "");
-
-      retval = m;
+      m.setfield ("type", "anonymous");
     }
   else
-    error ("functions: FCN_HANDLE is not a valid function handle object");
+    {
+      m.setfield ("function", fh_nm);
+
+      if (fcn->is_subfunction ())
+        {
+          m.setfield ("type", "subfunction");
+          Cell parentage (dim_vector (1, 2));
+          parentage.elem (0) = fh_nm;
+          parentage.elem (1) = fcn->parent_fcn_name ();
+          m.setfield ("parentage", octave_value (parentage));
+        }
+      else if (fcn->is_private_function ())
+        m.setfield ("type", "private");
+      else if (fh->is_overloaded ())
+        m.setfield ("type", "overloaded");
+      else
+        m.setfield ("type", "simple");
+    }
+
+  std::string nm = fcn->fcn_file_name ();
+
+  if (fh_nm == octave_fcn_handle::anonymous)
+    {
+      m.setfield ("file", nm);
+
+      octave_user_function *fu = fh->user_function_value ();
 
-  return retval;
+      std::list<symbol_table::symbol_record> vars
+        = symbol_table::all_variables (fu->scope (), 0);
+
+      size_t varlen = vars.size ();
+
+      if (varlen > 0)
+        {
+          octave_scalar_map ws;
+          for (std::list<symbol_table::symbol_record>::const_iterator
+                 p = vars.begin (); p != vars.end (); p++)
+            {
+              ws.assign (p->name (), p->varval (0));
+            }
+
+          m.setfield ("workspace", ws);
+        }
+    }
+  else if (fcn->is_user_function () || fcn->is_user_script ())
+    {
+      octave_function *fu = fh->function_value ();
+      m.setfield ("file", fu->fcn_file_name ());
+    }
+  else
+    m.setfield ("file", "");
+
+  return ovl (m);
 }
 
 DEFUN (func2str, args, ,
@@ -1806,30 +1802,28 @@
 @seealso{str2func, functions}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
   octave_fcn_handle *fh = args(0).fcn_handle_value ("func2str: FCN_HANDLE argument must be a function handle object");
 
-  if (fh)
-    {
-      std::string fh_nm = fh->fcn_name ();
+  if (! fh)
+    error ("func2str: FCN_HANDLE must be a valid function handle");
+
+  octave_value retval;
+
+  std::string fh_nm = fh->fcn_name ();
 
-      if (fh_nm == octave_fcn_handle::anonymous)
-        {
-          std::ostringstream buf;
+  if (fh_nm == octave_fcn_handle::anonymous)
+    {
+      std::ostringstream buf;
 
-          fh->print_raw (buf);
+      fh->print_raw (buf);
 
-          retval = buf.str ();
-        }
-      else
-        retval = fh_nm;
+      retval = buf.str ();
     }
   else
-    error ("func2str: FCN_HANDLE must be a valid function handle");
+    retval = fh_nm;
 
   return retval;
 }
@@ -1845,8 +1839,6 @@
 @seealso{func2str, inline}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 1 || nargin > 2)
@@ -1854,6 +1846,8 @@
 
   std::string nm = args(0).xstring_value ("str2func: FCN_NAME must be a string");
 
+  octave_value retval;
+
   if (nm[0] == '@')
     {
       int parse_status;
@@ -1911,7 +1905,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_function_handle ());
+  return ovl (args(0).is_function_handle ());
 }
 
 /*
--- a/libinterp/octave-value/ov-fcn-inline.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-fcn-inline.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -675,8 +675,6 @@
 @seealso{argnames, formula, vectorize, str2func}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin == 0)
@@ -735,8 +733,7 @@
               if (c == 'e' || c == 'E')
                 {
                   // possible number in exponent form, not arg
-                  if (isdigit (fun[i])
-                      || fun[i] == '-' || fun[i] == '+')
+                  if (isdigit (fun[i]) || fun[i] == '-' || fun[i] == '+')
                     continue;
                 }
               is_arg = true;
@@ -809,7 +806,7 @@
         }
     }
 
-  return octave_value (new octave_fcn_inline (fun, fargs));
+  return ovl (new octave_fcn_inline (fun, fargs));
 }
 
 /*
@@ -839,19 +836,15 @@
 @seealso{char, argnames, inline, vectorize}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
   octave_fcn_inline* fn = args(0).fcn_inline_value (true);
 
-  if (fn)
-    retval = octave_value (fn->fcn_text ());
-  else
+  if (! fn)
     error ("formula: FUN must be an inline function");
 
-  return retval;
+  return ovl (fn->fcn_text ());
 }
 
 /*
@@ -872,28 +865,22 @@
 @seealso{inline, formula, vectorize}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
   octave_fcn_inline *fn = args(0).fcn_inline_value (true);
 
-  if (fn)
-    {
-      string_vector t1 = fn->fcn_arg_names ();
-
-      Cell t2 (dim_vector (t1.numel (), 1));
-
-      for (int i = 0; i < t1.numel (); i++)
-        t2(i) = t1(i);
-
-      retval = t2;
-    }
-  else
+  if (! fn)
     error ("argnames: FUN must be an inline function");
 
-  return retval;
+  string_vector t1 = fn->fcn_arg_names ();
+
+  Cell t2 (dim_vector (t1.numel (), 1));
+
+  for (int i = 0; i < t1.numel (); i++)
+    t2(i) = t1(i);
+
+  return ovl (t2);
 }
 
 /*
@@ -927,8 +914,6 @@
 @seealso{inline, formula, argnames}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
@@ -974,12 +959,9 @@
     }
 
   if (func_is_string)
-    retval = octave_value (new_func);
+    return ovl (new_func);
   else
-    retval = octave_value (new octave_fcn_inline
-                           (new_func, old->fcn_arg_names ()));
-
-  return retval;
+    return ovl (new octave_fcn_inline (new_func, old->fcn_arg_names ()));
 }
 
 /*
--- a/libinterp/octave-value/ov-flt-re-mat.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-flt-re-mat.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -895,7 +895,7 @@
                               octave_float_scalar);
     }
 
-  return octave_value ();
+  return octave_value_list ();
 }
 
 /*
--- a/libinterp/octave-value/ov-java.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-java.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -2130,36 +2130,28 @@
 @seealso{javaMethod, javaArray}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_JAVA
 
+  if (args.length () == 0)
+    print_usage ();
+
+  std::string classname = args(0).xstring_value ("javaObject: CLASSNAME must be a string");
+
   initialize_java ();
 
   JNIEnv *current_env = octave_java::thread_jni_env ();
 
-  if (args.length () == 0)
-    print_usage ();
-
-  if (args(0).is_string ())
-    {
-      std::string classname = args(0).string_value ();
-
-      octave_value_list tmp;
-      for (int i=1; i<args.length (); i++)
-        tmp(i-1) = args(i);
-      retval = octave_java::do_javaObject (current_env, classname, tmp);
-    }
-  else
-    error ("javaObject: CLASSNAME must be a string");
+  octave_value_list tmp;
+  for (int i=1; i<args.length (); i++)
+    tmp(i-1) = args(i);
+
+  return ovl (octave_java::do_javaObject (current_env, classname, tmp));
 
 #else
 
   error ("javaObject: Octave was not compiled with Java interface");
 
 #endif
-
-  return retval;
 }
 
 /*
@@ -2196,48 +2188,43 @@
 @seealso{methods, javaObject}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_JAVA
 
+  if (args.length () < 2)
+    print_usage ();
+
+  std::string methodname = args(0).xstring_value ("javaMethod: METHODNAME must be a string");
+
   initialize_java ();
 
   JNIEnv *current_env = octave_java::thread_jni_env ();
 
-  if (args.length () < 2)
-    print_usage ();
-
-  if (args(0).is_string ())
+  octave_value retval;
+
+  octave_value_list tmp;
+  for (int i=2; i<args.length (); i++)
+    tmp(i-2) = args(i);
+
+  if (args(1).is_java ())
     {
-      std::string methodname = args(0).string_value ();
-
-      octave_value_list tmp;
-      for (int i=2; i<args.length (); i++)
-        tmp(i-2) = args(i);
-
-      if (args(1).is_java ())
-        {
-          octave_java *jobj = TO_JAVA (args(1));
-          retval = jobj->do_javaMethod (current_env, methodname, tmp);
-        }
-      else if (args(1).is_string ())
-        {
-          std::string cls = args(1).string_value ();
-          retval = octave_java::do_javaMethod (current_env, cls, methodname, tmp);
-        }
-      else
-        error ("javaMethod: OBJ must be a Java object or a string");
+      octave_java *jobj = TO_JAVA (args(1));
+      retval = jobj->do_javaMethod (current_env, methodname, tmp);
+    }
+  else if (args(1).is_string ())
+    {
+      std::string cls = args(1).string_value ();
+      retval = octave_java::do_javaMethod (current_env, cls, methodname, tmp);
     }
   else
-    error ("javaMethod: METHODNAME must be a string");
+    error ("javaMethod: OBJ must be a Java object or a string");
+
+  return retval;
 
 #else
 
   error ("javaMethod: Octave was not compiled with Java interface");
 
 #endif
-
-  return retval;
 }
 
 /*
@@ -2269,44 +2256,39 @@
 @seealso{__java_set__, javaMethod, javaObject}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_JAVA
 
+  if (args.length () != 2)
+    print_usage ();
+
+  std::string name = args(1).string_value ("__java_get__: NAME must be a string");
+
   initialize_java ();
 
   JNIEnv *current_env = octave_java::thread_jni_env ();
 
-  if (args.length () != 2)
-    print_usage ();
-
-  if (args(1).is_string ())
+  octave_value retval;
+
+  if (args(0).is_java ())
     {
-      std::string name = args(1).string_value ();
-
-      if (args(0).is_java ())
-        {
-          octave_java *jobj = TO_JAVA (args(0));
-          retval = jobj->do_java_get (current_env, name);
-        }
-      else if (args(0).is_string ())
-        {
-          std::string cls = args(0).string_value ();
-          retval = octave_java::do_java_get (current_env, cls, name);
-        }
-      else
-        error ("__java_get__: OBJ must be a Java object or a string");
+      octave_java *jobj = TO_JAVA (args(0));
+      retval = jobj->do_java_get (current_env, name);
+    }
+  else if (args(0).is_string ())
+    {
+      std::string cls = args(0).string_value ();
+      retval = octave_java::do_java_get (current_env, cls, name);
     }
   else
-    error ("__java_get__: NAME must be a string");
+    error ("__java_get__: OBJ must be a Java object or a string");
+
+  return retval;
 
 #else
 
   error ("__java_get__: Octave was not compiled with Java interface");
 
 #endif
-
-  return retval;
 }
 
 DEFUN (__java_set__, args, ,
@@ -2332,44 +2314,39 @@
 @seealso{__java_get__, javaMethod, javaObject}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_JAVA
 
+  if (args.length () != 3)
+    print_usage ();
+
+  std::string name = args(1).xstring_value ("__java_set__: NAME must be a string");
+
   initialize_java ();
 
   JNIEnv *current_env = octave_java::thread_jni_env ();
 
-  if (args.length () != 3)
-    print_usage ();
-
-  if (args(1).is_string ())
+  octave_value retval;
+
+  if (args(0).is_java ())
     {
-      std::string name = args(1).string_value ();
-
-      if (args(0).is_java ())
-        {
-          octave_java *jobj = TO_JAVA (args(0));
-          retval = jobj->do_java_set (current_env, name, args(2));
-        }
-      else if (args(0).is_string ())
-        {
-          std::string cls = args(0).string_value ();
-          retval = octave_java::do_java_set (current_env, cls, name, args(2));
-        }
-      else
-        error ("__java_set__: OBJ must be a Java object or a string");
+      octave_java *jobj = TO_JAVA (args(0));
+      retval = jobj->do_java_set (current_env, name, args(2));
+    }
+  else if (args(0).is_string ())
+    {
+      std::string cls = args(0).string_value ();
+      retval = octave_java::do_java_set (current_env, cls, name, args(2));
     }
   else
-    error ("__java_set__: NAME must be a string");
+    error ("__java_set__: OBJ must be a Java object or a string");
+
+  return retval;
 
 #else
 
   error ("__java_set__: Octave was not compiled with Java interface");
 
 #endif
-
-  return retval;
 }
 
 DEFUN (java2mat, args, ,
@@ -2378,32 +2355,32 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value_list retval;
-
 #ifdef HAVE_JAVA
 
+  if (args.length () != 1)
+    print_usage ();
+
   initialize_java ();
 
   JNIEnv *current_env = octave_java::thread_jni_env ();
 
-  if (args.length () != 1)
-    print_usage ();
+  octave_value_list retval;
 
   if (args(0).is_java ())
     {
       octave_java *jobj = TO_JAVA (args(0));
-      retval(0) = box_more (current_env, jobj->to_java (), 0);
+      retval = ovl (box_more (current_env, jobj->to_java (), 0));
     }
   else
-    retval(0) = args(0);
+    retval = ovl (args(0));
+
+  return retval;
 
 #else
 
   error ("java2mat: Octave was not compiled with Java interface");
 
 #endif
-
-  return retval;
 }
 
 DEFUN (java_matrix_autoconversion, args, nargout,
@@ -2422,18 +2399,11 @@
 @seealso{java_unsigned_autoconversion, debug_java}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
 #ifdef HAVE_JAVA
-
-  retval = SET_INTERNAL_VARIABLE (java_matrix_autoconversion);
+  return SET_INTERNAL_VARIABLE (java_matrix_autoconversion);
 #else
-
   error ("java_matrix_autoconversion: Octave was not compiled with Java interface");
-
 #endif
-
-  return retval;
 }
 
 DEFUN (java_unsigned_autoconversion, args, nargout,
@@ -2494,7 +2464,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_java ());
+  return ovl (args(0).is_java ());
 }
 
 /*
--- a/libinterp/octave-value/ov-null-mat.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-null-mat.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -117,7 +117,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_null_value ());
+  return ovl (args(0).is_null_value ());
 }
 
 /*
--- a/libinterp/octave-value/ov-oncleanup.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-oncleanup.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -189,7 +189,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (new octave_oncleanup (args(0)));
+  return ovl (new octave_oncleanup (args(0)));
 }
 
 /*
--- a/libinterp/octave-value/ov-re-mat.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-re-mat.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1030,7 +1030,7 @@
       OCTAVE_TYPE_CONV_BODY3 (double, octave_matrix, octave_scalar);
     }
 
-  return octave_value ();
+  return octave_value_list ();
 }
 
 /*
--- a/libinterp/octave-value/ov-struct.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-struct.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -1845,7 +1845,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_map ());
+  return ovl (args(0).is_map ());
 }
 
 DEFUN (__fieldnames__, args, ,
@@ -1887,12 +1887,10 @@
 @seealso{fieldnames}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
-  retval = false;
+  octave_value retval = false;
 
   if (args(0).is_map ())
     {
@@ -1900,7 +1898,6 @@
 
       // FIXME: should this work for all types that can do
       // structure reference operations?
-
       if (args(1).is_string ())
         {
           std::string key = args(1).string_value ();
@@ -1939,17 +1936,13 @@
 @seealso{fieldnames}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
-  if (args(0).is_map ())
-    retval = static_cast<double> (args(0).nfields ());
-  else
+  if (! args(0).is_map ())
     error ("numfields: argument must be a struct");
 
-  return retval;
+  return ovl (static_cast<double> (args(0).nfields ()));
 }
 
 /*
@@ -1992,8 +1985,6 @@
 @seealso{struct2cell, cell2mat, struct}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin < 2 || nargin > 3)
@@ -2005,11 +1996,6 @@
   if (! (args(1).is_cellstr () || args(1).is_char_matrix ()))
     error ("cell2struct: FIELDS must be a cell array of strings or a character matrix");
 
-  const Cell vals = args(0).cell_value ();
-  const Array<std::string> fields = args(1).cellstr_value ();
-
-  octave_idx_type ext = 0;
-
   int dim = 0;
 
   if (nargin == 3)
@@ -2023,7 +2009,10 @@
   if (dim < 0)
     error ("cell2struct: DIM must be a valid dimension");
 
-  ext = vals.ndims () > dim ? vals.dims ()(dim) : 1;
+  const Cell vals = args(0).cell_value ();
+  const Array<std::string> fields = args(1).cellstr_value ();
+
+  octave_idx_type ext = vals.ndims () > dim ? vals.dims ()(dim) : 1;
 
   if (ext != fields.numel ())
     error ("cell2struct: number of FIELDS does not match dimension");
@@ -2055,9 +2044,7 @@
       map.setfield (fields(i), vals.index (ia).reshape (rdv));
     }
 
-  retval = map;
-
-  return retval;
+  return ovl (map);
 }
 
 /*
@@ -2093,8 +2080,6 @@
 @seealso{orderfields, fieldnames, isfield}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 2)
     print_usage ();
 
@@ -2114,9 +2099,7 @@
         error ("rmfield: structure does not contain field %s", key.c_str ());
     }
 
-  retval = m;
-
-  return retval;
+  return ovl (m);
 }
 
 /*
--- a/libinterp/octave-value/ov-typeinfo.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-typeinfo.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -621,19 +621,15 @@
 @seealso{class, isa}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
   if (nargin == 0)
-    retval = Cell (octave_value_typeinfo::installed_type_names ());
+    return ovl (Cell (octave_value_typeinfo::installed_type_names ()));
   else
-    retval = args(0).type_name ();
-
-  return retval;
+    return ovl (args(0).type_name ());
 }
 
 /*
--- a/libinterp/octave-value/ov-usr-fcn.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov-usr-fcn.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -818,13 +818,13 @@
 @seealso{nargout, narginchk, varargin, inputname}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 1)
     {
       octave_value func = args(0);
@@ -838,27 +838,25 @@
         }
 
       octave_function *fcn_val = func.function_value ();
-      if (fcn_val)
-        {
-          octave_user_function *fcn = fcn_val->user_function_value (true);
+      if (! fcn_val)
+        error ("nargin: FCN must be a string or function handle");
 
-          if (fcn)
-            {
-              tree_parameter_list *param_list = fcn->parameter_list ();
+      octave_user_function *fcn = fcn_val->user_function_value (true);
 
-              retval = param_list ? param_list->length () : 0;
-              if (fcn->takes_varargs ())
-                retval = -1 - retval;
-            }
-          else
-            {
-              // Matlab gives up for histc,
-              // so maybe it's ok that that we give up somtimes too?
-              error ("nargin: nargin information not available for built-in functions");
-            }
+      if (fcn)
+        {
+          tree_parameter_list *param_list = fcn->parameter_list ();
+
+          retval = param_list ? param_list->length () : 0;
+          if (fcn->takes_varargs ())
+            retval = -1 - retval;
         }
       else
-        error ("nargin: FCN must be a string or function handle");
+        {
+          // Matlab gives up for histc,
+          // so maybe it's ok that that we give up somtimes too?
+          error ("nargin: nargin information not available for built-in functions");
+        }
     }
   else
     {
@@ -926,13 +924,13 @@
 @seealso{nargin, varargout, isargout, nthargout}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   int nargin = args.length ();
 
   if (nargin > 1)
     print_usage ();
 
+  octave_value retval;
+
   if (nargin == 1)
     {
       octave_value func = args(0);
@@ -946,10 +944,7 @@
         }
 
       if (func.is_inline_function ())
-        {
-          retval = 1;
-          return retval;
-        }
+        return ovl (1);
 
       if (func.is_function_handle ())
         {
@@ -957,37 +952,32 @@
           std::string fh_nm = fh->fcn_name ();
 
           if (fh_nm == octave_fcn_handle::anonymous)
-            {
-              retval = -1;
-              return retval;
-            }
+            return ovl (-1);
         }
 
       octave_function *fcn_val = func.function_value ();
-      if (fcn_val)
-        {
-          octave_user_function *fcn = fcn_val->user_function_value (true);
+      if (! fcn_val)
+        error ("nargout: FCN must be a string or function handle");
 
-          if (fcn)
-            {
-              tree_parameter_list *ret_list = fcn->return_list ();
-
-              retval = ret_list ? ret_list->length () : 0;
+      octave_user_function *fcn = fcn_val->user_function_value (true);
 
-              if (fcn->takes_var_return ())
-                retval = -1 - retval;
-            }
-          else
-            {
-              // JWE said this information is not available (2011-03-10)
-              // without making intrusive changes to Octave.
-              // Matlab gives up for histc,
-              // so maybe it's ok that we give up somtimes too?
-              error ("nargout: nargout information not available for built-in functions.");
-            }
+      if (fcn)
+        {
+          tree_parameter_list *ret_list = fcn->return_list ();
+
+          retval = ret_list ? ret_list->length () : 0;
+
+          if (fcn->takes_var_return ())
+            retval = -1 - retval;
         }
       else
-        error ("nargout: FCN must be a string or function handle");
+        {
+          // JWE said this information is not available (2011-03-10)
+          // without making intrusive changes to Octave.
+          // Matlab gives up for histc,
+          // so maybe it's ok that we give up somtimes too?
+          error ("nargout: nargout information not available for built-in functions.");
+        }
     }
   else
     {
@@ -1058,43 +1048,39 @@
 @seealso{nargout, varargout, nthargout}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 1)
     print_usage ();
 
-  if (! symbol_table::at_top_level ())
-    {
-      int nargout1 = symbol_table::varval (".nargout.").int_value ();
+  if (symbol_table::at_top_level ())
+    error ("isargout: invalid call at top level");
+
+  int nargout1 = symbol_table::varval (".nargout.").int_value ();
 
-      Matrix ignored;
-      octave_value tmp = symbol_table::varval (".ignored.");
-      if (tmp.is_defined ())
-        ignored = tmp.matrix_value ();
-
-      if (args(0).is_scalar_type ())
-        {
-          double k = args(0).double_value ();
+  Matrix ignored;
+  octave_value tmp = symbol_table::varval (".ignored.");
+  if (tmp.is_defined ())
+    ignored = tmp.matrix_value ();
 
-          retval = isargout1 (nargout1, ignored, k);
-        }
-      else if (args(0).is_numeric_type ())
-        {
-          const NDArray ka = args(0).array_value ();
+  if (args(0).is_scalar_type ())
+    {
+      double k = args(0).double_value ();
 
-          boolNDArray r (ka.dims ());
-          for (octave_idx_type i = 0; i < ka.numel (); i++)
-            r(i) = isargout1 (nargout1, ignored, ka(i));
+      return ovl (isargout1 (nargout1, ignored, k));
+    }
+  else if (args(0).is_numeric_type ())
+    {
+      const NDArray ka = args(0).array_value ();
 
-          retval = r;
-        }
-      else
-        gripe_wrong_type_arg ("isargout", args(0));
+      boolNDArray r (ka.dims ());
+      for (octave_idx_type i = 0; i < ka.numel (); i++)
+        r(i) = isargout1 (nargout1, ignored, ka(i));
+
+      return ovl (r);
     }
   else
-    error ("isargout: invalid call at top level");
+    gripe_wrong_type_arg ("isargout", args(0));
 
-  return retval;
+  return octave_value_list ();
 }
 
 /*
--- a/libinterp/octave-value/ov.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave-value/ov.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -2930,7 +2930,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).byte_size ());
+  return ovl (args(0).byte_size ());
 }
 
 /*
@@ -3049,9 +3049,9 @@
   octave_value arg0 = args(0);
 
   if (type.empty ())
-    retval = arg0;
+    return ovl (arg0);
   else
-    retval = arg0.subsref (type, idx, nargout);
+    return arg0.subsref (type, idx, nargout);
 
   return retval;
 }
@@ -3089,8 +3089,6 @@
 @seealso{subsref, substruct}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 3)
     print_usage ();
 
@@ -3102,8 +3100,7 @@
   if (type.empty ())
     {
       // Regularize a null matrix if stored into a variable.
-
-      retval = args(2).storable_value ();
+      return ovl (args(2).storable_value ());
     }
   else
     {
@@ -3111,10 +3108,8 @@
 
       arg0.make_unique ();
 
-      retval= arg0.subsasgn (type, idx, args(2));
+      return ovl (arg0.subsasgn (type, idx, args(2)));
     }
-
-  return retval;
 }
 
 /*
@@ -3194,7 +3189,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_sq_string ());
+  return ovl (args(0).is_sq_string ());
 }
 
 /*
@@ -3217,7 +3212,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return octave_value (args(0).is_dq_string ());
+  return ovl (args(0).is_dq_string ());
 }
 
 /*
--- a/libinterp/octave.cc	Fri Dec 18 16:22:53 2015 -0500
+++ b/libinterp/octave.cc	Fri Dec 18 15:37:22 2015 -0800
@@ -205,8 +205,6 @@
 Undocumented internal function.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   static octave_map vinfo;
 
   int nargin = args.length ();
@@ -214,14 +212,18 @@
   if (nargin != 0 && nargin != 4)
     print_usage ();
 
-  if (nargin == 4)
+  octave_value retval;
+
+  if (nargin == 0)
+    retval = vinfo;
+  else if (nargin == 4)
     {
       if (vinfo.nfields () == 0)
         {
-          vinfo.assign ("Name", args (0));
-          vinfo.assign ("Version", args (1));
-          vinfo.assign ("Release", args (2));
-          vinfo.assign ("Date", args (3));
+          vinfo.assign ("Name", args(0));
+          vinfo.assign ("Version", args(1));
+          vinfo.assign ("Release", args(2));
+          vinfo.assign ("Date", args(3));
         }
       else
         {
@@ -231,14 +233,12 @@
 
           octave_value idx (n);
 
-          vinfo.assign (idx, "Name", Cell (octave_value (args (0))));
-          vinfo.assign (idx, "Version", Cell (octave_value (args (1))));
-          vinfo.assign (idx, "Release", Cell (octave_value (args (2))));
-          vinfo.assign (idx, "Date", Cell (octave_value (args (3))));
+          vinfo.assign (idx, "Name", Cell (octave_value (args(0))));
+          vinfo.assign (idx, "Version", Cell (octave_value (args(1))));
+          vinfo.assign (idx, "Release", Cell (octave_value (args(2))));
+          vinfo.assign (idx, "Date", Cell (octave_value (args(3))));
         }
     }
-  else if (nargin == 0)
-    retval = vinfo;
 
   return retval;
 }
@@ -1015,14 +1015,10 @@
 @seealso{have_window_system}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 0)
     print_usage ();
 
-  retval = start_gui;
-
-  return retval;
+  return ovl (start_gui);
 }
 
 /*
@@ -1050,14 +1046,10 @@
 an example of how to create an executable Octave script.\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 0)
     print_usage ();
 
-  retval = Cell (octave_argv);
-
-  return retval;
+  return ovl (Cell (octave_argv));
 }
 
 /*
@@ -1077,14 +1069,10 @@
 @seealso{program_name}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 0)
     print_usage ();
 
-  retval = octave_program_invocation_name;
-
-  return retval;
+  return ovl (octave_program_invocation_name);
 }
 
 /*
@@ -1100,14 +1088,10 @@
 @seealso{program_invocation_name}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
   if (args.length () != 0)
     print_usage ();
 
-  retval = octave_program_name;
-
-  return retval;
+  return ovl (octave_program_name);
 }
 
 /*