diff -r e429ddca0d51 libinterp/corefcn/__dsearchn__.cc
--- a/libinterp/corefcn/__dsearchn__.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/__dsearchn__.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -95,8 +95,7 @@
           pxi += n;
         }
 
-      retval(1) = dist;
-      retval(0) = idx;
+      retval = ovl (idx, dist);
     }
 
   return retval;
diff -r e429ddca0d51 libinterp/corefcn/balance.cc
--- a/libinterp/corefcn/balance.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/balance.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -158,17 +158,17 @@
               FloatComplexAEPBALANCE result (fcaa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
-                retval(0) = result.balanced_matrix ();
+                retval = ovl (result.balanced_matrix ());
               else if (nargout == 2)
                 {
-                  retval(1) = result.balanced_matrix ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balanced_matrix ());
                 }
               else
                 {
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.permuting_vector ();
-                  retval(0) = result.scaling_vector ();
+                  retval = ovl (result.scaling_vector (),
+                                result.permuting_vector (),
+                                result.balanced_matrix ());
                 }
 
             }
@@ -177,17 +177,17 @@
               FloatAEPBALANCE result (faa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
-                retval(0) = result.balanced_matrix ();
+                retval = ovl (result.balanced_matrix ());
               else if (nargout == 2)
                 {
-                  retval(1) = result.balanced_matrix ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balanced_matrix ());
                 }
               else
                 {
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.permuting_vector ();
-                  retval(0) = result.scaling_vector ();
+                  retval = ovl (result.scaling_vector (),
+                                result.permuting_vector (),
+                                result.balanced_matrix ());
                 }
             }
         }
@@ -198,17 +198,17 @@
               ComplexAEPBALANCE result (caa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
-                retval(0) = result.balanced_matrix ();
+                retval = ovl (result.balanced_matrix ());
               else if (nargout == 2)
                 {
-                  retval(1) = result.balanced_matrix ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balanced_matrix ());
                 }
               else
                 {
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.permuting_vector ();
-                  retval(0) = result.scaling_vector ();
+                  retval = ovl (result.scaling_vector (),
+                                result.permuting_vector (),
+                                result.balanced_matrix ());
                 }
             }
           else
@@ -216,17 +216,17 @@
               AEPBALANCE result (aa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
-                retval(0) = result.balanced_matrix ();
+                retval = ovl (result.balanced_matrix ());
               else if (nargout == 2)
                 {
-                  retval(1) = result.balanced_matrix ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balanced_matrix ());
                 }
               else
                 {
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.permuting_vector ();
-                  retval(0) = result.scaling_vector ();
+                  retval = ovl (result.scaling_vector (),
+                                result.permuting_vector (),
+                                result.balanced_matrix ());
                 }
             }
         }
@@ -282,15 +282,15 @@
                   retval(3) = result.balanced_matrix2 ();
                   // fall through
                 case 3:
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.balancing_matrix2 ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balancing_matrix2 (),
+                                result.balanced_matrix ());
                   break;
                 case 2:
                   retval(1) = result.balancing_matrix2 ();
                   // fall through
                 case 1:
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix ());
                   break;
                 default:
                   error ("balance: invalid number of output arguments");
@@ -307,15 +307,15 @@
                   retval(3) = result.balanced_matrix2 ();
                   // fall through
                 case 3:
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.balancing_matrix2 ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balancing_matrix2 (),
+                                result.balanced_matrix ());
                   break;
                 case 2:
                   retval(1) = result.balancing_matrix2 ();
                   // fall through
                 case 1:
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix ());
                   break;
                 default:
                   error ("balance: invalid number of output arguments");
@@ -335,15 +335,15 @@
                   retval(3) = result.balanced_matrix2 ();
                   // fall through
                 case 3:
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.balancing_matrix2 ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balancing_matrix2 (),
+                                result.balanced_matrix ());
                   break;
                 case 2:
                   retval(1) = result.balancing_matrix2 ();
                   // fall through
                 case 1:
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix ());
                   break;
                 default:
                   error ("balance: invalid number of output arguments");
@@ -360,15 +360,15 @@
                   retval(3) = result.balanced_matrix2 ();
                   // fall through
                 case 3:
-                  retval(2) = result.balanced_matrix ();
-                  retval(1) = result.balancing_matrix2 ();
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix (),
+                                result.balancing_matrix2 (),
+                                result.balanced_matrix ());
                   break;
                 case 2:
                   retval(1) = result.balancing_matrix2 ();
                   // fall through
                 case 1:
-                  retval(0) = result.balancing_matrix ();
+                  retval = ovl (result.balancing_matrix ());
                   break;
                 default:
                   error ("balance: invalid number of output arguments");
diff -r e429ddca0d51 libinterp/corefcn/colloc.cc
--- a/libinterp/corefcn/colloc.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/colloc.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -95,10 +95,7 @@
   Matrix B = wts.second ();
   ColumnVector q = wts.quad_weights ();
 
-  retval(3) = q;
-  retval(2) = B;
-  retval(1) = A;
-  retval(0) = r;
+  retval = ov (r, A, B, q);
 
   return retval;
 }
diff -r e429ddca0d51 libinterp/corefcn/data.cc
--- a/libinterp/corefcn/data.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/data.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -500,7 +500,7 @@
     print_usage ();
 
   if (nargout < 2)
-    retval(0) = args(0).log2 ();
+    retval = ovl (args(0).log2 ());
   else if (args(0).is_single_type ())
     {
       if (args(0).is_real_type ())
@@ -510,8 +510,7 @@
           // FIXME: should E be an int value?
           FloatMatrix e;
           map_2_xlog2 (x, f, e);
-          retval(1) = e;
-          retval(0) = f;
+          retval = ovl (f, e);
         }
       else if (args(0).is_complex_type ())
         {
@@ -520,8 +519,7 @@
           // FIXME: should E be an int value?
           FloatNDArray e;
           map_2_xlog2 (x, f, e);
-          retval(1) = e;
-          retval(0) = f;
+          retval = ovl (f, e);
         }
     }
   else if (args(0).is_real_type ())
@@ -531,8 +529,7 @@
       // FIXME: should E be an int value?
       Matrix e;
       map_2_xlog2 (x, f, e);
-      retval(1) = e;
-      retval(0) = f;
+      retval = ovl (f, e);
     }
   else if (args(0).is_complex_type ())
     {
@@ -541,8 +538,7 @@
       // FIXME: should E be an int value?
       NDArray e;
       map_2_xlog2 (x, f, e);
-      retval(1) = e;
-      retval(0) = f;
+      retval = ovl (f, e);
     }
   else
     gripe_wrong_type_arg ("log2", args(0));
@@ -6390,9 +6386,7 @@
 
 #endif
 
-  retval(2) = sys;
-  retval(1) = usr;
-  retval(0) = sys + usr;
+  retval = ovl (sys + usr, usr, sys);
 
   return retval;
 }
@@ -6529,11 +6523,11 @@
 
       Array<octave_idx_type> sidx;
 
-      retval(0) = arg.sort (sidx, dim, smode);
-      retval(1) = idx_vector (sidx, dv(dim)); // No checking, extent is known.
+      retval = ovl (arg.sort (sidx, dim, smode),
+                    idx_vector (sidx, dv(dim))); // No checking, extent is known.
     }
   else
-    retval(0) = arg.sort (dim, smode);
+    retval = ovl (arg.sort (dim, smode));
 
   return retval;
 }
@@ -6892,8 +6886,8 @@
 %!error <needs a vector> issorted ([])
 
 ## Test input validation
-%!error issorted () 
-%!error issorted (1,2,3,4) 
+%!error issorted ()
+%!error issorted (1,2,3,4)
 %!error <second argument must be a string> issorted (1, 2)
 %!error <second argument must be a string> issorted (1, {"rows"})
 %!error <sparse matrices not yet supported> issorted (sparse ([1 2 3]), "rows")
diff -r e429ddca0d51 libinterp/corefcn/debug.cc
--- a/libinterp/corefcn/debug.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/debug.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -1212,8 +1212,8 @@
                                                      curr_frame,
                                                      false);
 
-      retval(1) = curr_frame < 0 ? 1 : curr_frame + 1;
-      retval(0) = stk;
+      retval = ovl (stk,
+                    curr_frame < 0 ? 1 : curr_frame + 1);
     }
 
   return retval;
diff -r e429ddca0d51 libinterp/corefcn/dirfns.cc
--- a/libinterp/corefcn/dirfns.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/dirfns.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -123,7 +123,7 @@
 @end deftypefn")
 {
   int nargin = args.length ();
- 
+
   if (nargin > 1)
     print_usage ();
 
diff -r e429ddca0d51 libinterp/corefcn/eig.cc
--- a/libinterp/corefcn/eig.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/eig.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -153,7 +153,7 @@
 
       if (nargout == 0 || nargout == 1)
         {
-          retval(0) = result.eigenvalues ();
+          retval = ovl (result.eigenvalues ());
         }
       else
         {
@@ -161,8 +161,7 @@
 
           FloatComplexDiagMatrix d (result.eigenvalues ());
 
-          retval(1) = d;
-          retval(0) = result.eigenvectors ();
+          retval = ovl (result.eigenvectors (), d);
         }
     }
   else
@@ -204,7 +203,7 @@
 
       if (nargout == 0 || nargout == 1)
         {
-          retval(0) = result.eigenvalues ();
+          retval = ovl (result.eigenvalues ());
         }
       else
         {
@@ -212,8 +211,7 @@
 
           ComplexDiagMatrix d (result.eigenvalues ());
 
-          retval(1) = d;
-          retval(0) = result.eigenvectors ();
+          retval = ovl (result.eigenvectors (), d);
         }
     }
 
diff -r e429ddca0d51 libinterp/corefcn/file-io.cc
--- a/libinterp/corefcn/file-io.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/file-io.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -339,8 +339,7 @@
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
-  retval(1) = 0;
-  retval(0) = -1;
+  retval = ovl (-1, 0);
 
   octave_stream os = octave_stream_list::lookup (args(0), who);
 
@@ -352,8 +351,7 @@
 
   if (! err)
     {
-      retval(1) = tmp.length ();
-      retval(0) = tmp;
+      retval = ovl (tmp, tmp.length ());
     }
 
   return retval;
@@ -386,8 +384,7 @@
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
-  retval(1) = 0.0;
-  retval(0) = -1.0;
+  retval = ovl (-1.0, 0.0);
 
   octave_stream os = octave_stream_list::lookup (args(0), who);
 
@@ -399,8 +396,7 @@
 
   if (! err)
     {
-      retval(1) = tmp.length ();
-      retval(0) = tmp;
+      retval = ovl (tmp, tmp.length ());
     }
 
   return retval;
@@ -627,7 +623,7 @@
 {
   octave_value_list retval;
 
-  retval(0) = -1.0;
+  retval = ovl (-1.0);
 
   int nargin = args.length ();
 
@@ -647,9 +643,7 @@
         {
           string_vector tmp = octave_stream_list::get_info (args(0));
 
-          retval(2) = tmp(2);
-          retval(1) = tmp(1);
-          retval(0) = tmp(0);
+          retval = ovl (tmp(0), tmp(1), tmp(2));
 
           return retval;
         }
@@ -669,15 +663,13 @@
 
       if (os)
         {
-          retval(1) = "";
-          retval(0) = octave_stream_list::insert (os);
+          retval = ovl ("", octave_stream_list::insert (os));
         }
       else
         {
           int error_number = 0;
 
-          retval(1) = os.error (false, error_number);
-          retval(0) = -1.0;
+          retval = ovl (-1.0, os.error (false, error_number));
         }
     }
   else
@@ -992,9 +984,7 @@
   if (nargin == 0)
     print_usage ();
 
-  retval(2) = -1.0;
-  retval(1) = "unknown error";
-  retval(0) = "";
+  retval = ovl ("", "unknown error", -1.0);
 
   octave_ostrstream *ostr = new octave_ostrstream ();
 
@@ -1099,15 +1089,13 @@
       octave_stream os = octave_stream_list::lookup (args(0), who);
 
       if (args(1).is_string ())
-        retval = os.oscanf (args(1), who);
+        retval = ovl (os.oscanf (args(1), who));
       else
         error ("%s: format TEMPLATE must be a string", who.c_str ());
     }
   else
     {
-      retval(2) = "unknown error";
-      retval(1) = 0.0;
-      retval(0) = Matrix ();
+      retval = ovl (Matrix (), 0.0, "unknown error");
 
       octave_stream os = octave_stream_list::lookup (args(0), who);
 
@@ -1122,9 +1110,7 @@
 
           octave_value tmp = os.scanf (args(1), size, count, who);
 
-          retval(2) = os.error ();
-          retval(1) = count;
-          retval(0) = tmp;
+          retval = ovl (tmp, count, os.error ());
         }
       else
         error ("%s: format must be a string", who.c_str ());
@@ -1181,7 +1167,7 @@
       if (os.is_valid ())
         {
           if (args(1).is_string ())
-            retval = os.oscanf (args(1), who);
+            retval = ovl (os.oscanf (args(1), who));
           else
             error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
@@ -1190,10 +1176,7 @@
     }
   else
     {
-      retval(3) = -1.0;
-      retval(2) = "unknown error";
-      retval(1) = 0.0;
-      retval(0) = Matrix ();
+      retval = ovl (Matrix (), 0.0, "unknown error", -1.0);
 
       std::string data = get_sscanf_data (args(0));
 
@@ -1217,10 +1200,8 @@
               // position will clear it.
               std::string errmsg = os.error ();
 
-              retval(3) = (os.eof () ? data.length () : os.tell ()) + 1;
-              retval(2) = errmsg;
-              retval(1) = count;
-              retval(0) = tmp;
+              retval = ovl (tmp, count, errmsg,
+                            (os.eof () ? data.length () : os.tell ()) + 1;
             }
           else
             error ("%s: format TEMPLATE must be a string",
@@ -1478,8 +1459,7 @@
   if (nargin < 1 || nargin > 5)
     print_usage ();
 
-  retval(1) = -1.0;
-  retval(0) = Matrix ();
+  retval = ovl (Matrix (), -1.0);
 
   octave_stream os = octave_stream_list::lookup (args(0), "fread");
 
@@ -1511,8 +1491,7 @@
 
   octave_value tmp = do_fread (os, size, prec, skip, arch, count);
 
-  retval(1) = count;
-  retval(0) = tmp;
+  retval = ovl (tmp, count);
 
   return retval;
 }
@@ -1672,8 +1651,7 @@
 
   std::string error_message = os.error (clear, error_number);
 
-  retval(1) = error_number;
-  retval(0) = error_message;
+  retval = ovl (error_message, error_number);
 
   return retval;
 }
@@ -1865,8 +1843,7 @@
   if (args.length () != 0)
     print_usage ();
 
-  retval(1) = std::string ();
-  retval(0) = -1;
+  retval = ovl (-1, std::string ());
 
   FILE *fid = gnulib::tmpfile ();
 
@@ -1879,15 +1856,14 @@
       octave_stream s = octave_stdiostream::create (nm, fid, md);
 
       if (s)
-        retval(0) = octave_stream_list::insert (s);
+        retval = ovl (octave_stream_list::insert (s));
       else
         error ("tmpfile: failed to create octave_stdiostream object");
 
     }
   else
     {
-      retval(1) = gnulib::strerror (errno);
-      retval(0) = -1;
+      retval = ovl (-1, gnulib::strerror (errno));
     }
 
   return retval;
@@ -1923,9 +1899,7 @@
   if (nargin < 1 || nargin > 2)
     print_usage ();
 
-  retval(2) = std::string ();
-  retval(1) = std::string ();
-  retval(0) = -1;
+  retval = ovl (-1, std::string (), std::string ());
 
   std::string tmpl8 = args(0).xstring_value ("mkstemp: TEMPLATE argument must be a string");
 
@@ -1955,8 +1929,7 @@
 
           if (s)
             {
-              retval(1) = nm;
-              retval(0) = octave_stream_list::insert (s);
+              retval = ovl (octave_stream_list::insert (s), nm);
 
               if (nargin == 2 && args(1).is_true ())
                 mark_for_deletion (nm);
@@ -2045,7 +2018,7 @@
     }
 
   if (status >= 0)
-    retval(0) = status;
+    retval = ovl (status);
 
   return retval;
 }
diff -r e429ddca0d51 libinterp/corefcn/getgrent.cc
--- a/libinterp/corefcn/getgrent.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/getgrent.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -54,10 +54,10 @@
       m.assign ("gid", static_cast<double> (gr.gid ()));
       m.assign ("mem", octave_value (gr.mem ()));
 
-      retval = m;
+      retval = ovl (m);
     }
   else
-    retval = 0;
+    retval = ovl (0);
 
   return retval;
 }
@@ -81,8 +81,7 @@
   // octave_group::getgrent may set msg.
   octave_value val = mk_gr_map (octave_group::getgrent (msg));
 
-  retval(1) = msg;
-  retval(0) = val;
+  retval = ovl (val, msg);
 
   return retval;
 }
@@ -113,8 +112,7 @@
       // octave_group::getgrgid may set msg.
       octave_value val = mk_gr_map (octave_group::getgrgid (gid, msg));
 
-      retval(1) = msg;
-      retval(0) = val;
+      retval = ovl (val, msg);
     }
 
   else
@@ -145,8 +143,7 @@
   // octave_group::getgrnam may set msg.
   octave_value val = mk_gr_map (octave_group::getgrnam (s.c_str (), msg));
 
-  retval(1) = msg;
-  retval(0) = val;
+  retval = ovl (val, msg);
 
   return retval;
 }
@@ -168,8 +165,7 @@
   // octave_group::setgrent may set msg.
   int status = octave_group::setgrent (msg);
 
-  retval(1) = msg;
-  retval(0) = static_cast<double> (status);
+  retval = ovl (static_cast<double> (status), msg);
 
   return retval;
 }
@@ -191,8 +187,7 @@
   // octave_group::endgrent may set msg.
   int status = octave_group::endgrent (msg);
 
-  retval(1) = msg;
-  retval(0) = static_cast<double> (status);
+  retval = ovl (static_cast<double> (status), msg);
 
   return retval;
 }
diff -r e429ddca0d51 libinterp/corefcn/getpwent.cc
--- a/libinterp/corefcn/getpwent.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/getpwent.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -57,10 +57,10 @@
       m.assign ("dir", pw.dir ());
       m.assign ("shell", pw.shell ());
 
-      retval = m;
+      retval = ovl (m);
     }
   else
-    retval = 0;
+    retval = ovl (0);
 
   return retval;
 }
@@ -85,8 +85,7 @@
   // octave_passwd::getpwent may set msg.
   octave_value val = mk_pw_map (octave_passwd::getpwent (msg));
 
-  retval(1) = msg;
-  retval(0) = val;
+  retval = ovl (val, msg);
 
   return retval;
 }
@@ -117,8 +116,7 @@
       // octave_passwd::getpwuid may set msg.
       octave_value val = mk_pw_map (octave_passwd::getpwuid (uid, msg));
 
-      retval(1) = msg;
-      retval(0) = val;
+      retval = ovl (val, msg);
     }
   else
     error ("getpwuid: UID must be an integer");
@@ -148,8 +146,7 @@
   // octave_passwd::getpwnam may set msg.
   octave_value val = mk_pw_map (octave_passwd::getpwnam (s, msg));
 
-  retval(1) = msg;
-  retval(0) = val;
+  retval = ovl (val, msg);
 
   return retval;
 }
@@ -171,8 +168,7 @@
   // octave_passwd::setpwent may set msg.
   int status = octave_passwd::setpwent (msg);
 
-  retval(1) = msg;
-  retval(0) = static_cast<double> (status);
+  retval = ovl (static_cast<double> (status), msg);
 
   return retval;
 }
@@ -194,8 +190,7 @@
   // octave_passwd::endpwent may set msg.
   int status = octave_passwd::endpwent (msg);
 
-  retval(1) = msg;
-  retval(0) = static_cast<double> (status);
+  retval = ovl (static_cast<double> (status), msg);
 
   return retval;
 }
diff -r e429ddca0d51 libinterp/corefcn/givens.cc
--- a/libinterp/corefcn/givens.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/givens.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -92,12 +92,11 @@
             {
             case 0:
             case 1:
-              retval(0) = result;
+              retval = ovl (result);
               break;
 
             case 2:
-              retval(1) = result (0, 1);
-              retval(0) = result (0, 0);
+              retval = ovl (result(0, 0), result(0, 1));
               break;
             }
         }
@@ -112,12 +111,11 @@
             {
             case 0:
             case 1:
-              retval(0) = result;
+              retval = ovl (result);
               break;
 
             case 2:
-              retval(1) = result (0, 1);
-              retval(0) = result (0, 0);
+              retval = ovl (result(0, 0), result(0, 1));
               break;
             }
         }
@@ -135,12 +133,11 @@
             {
             case 0:
             case 1:
-              retval(0) = result;
+              retval = ovl (result);
               break;
 
             case 2:
-              retval(1) = result (0, 1);
-              retval(0) = result (0, 0);
+              retval = ovl (result(0, 0), result(0, 1));
               break;
             }
         }
@@ -155,12 +152,11 @@
             {
             case 0:
             case 1:
-              retval(0) = result;
+              retval = ovl (result);
               break;
 
             case 2:
-              retval(1) = result (0, 1);
-              retval(0) = result (0, 0);
+              retval = ovl (result(0, 0), result(0, 1));
               break;
             }
         }
diff -r e429ddca0d51 libinterp/corefcn/help.cc
--- a/libinterp/corefcn/help.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/help.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -1101,8 +1101,7 @@
 
   do_get_help_text (name, text, format);
 
-  retval(1) = format;
-  retval(0) = text;
+  retval = ovl (text, format);
 
   return retval;
 }
@@ -1164,8 +1163,7 @@
 
   do_get_help_text_from_file (fname, text, format);
 
-  retval(1) = format;
-  retval(0) = text;
+  retval = ovl (text, format);
 
   return retval;
 }
diff -r e429ddca0d51 libinterp/corefcn/hess.cc
--- a/libinterp/corefcn/hess.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/hess.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -96,11 +96,11 @@
           FloatHESS result (tmp);
 
           if (nargout <= 1)
-            retval(0) = result.hess_matrix ();
+            retval = ovl (result.hess_matrix ());
           else
             {
-              retval(1) = result.hess_matrix ();
-              retval(0) = result.unitary_hess_matrix ();
+              retval = ovl (result.unitary_hess_matrix (),
+                            result.hess_matrix ());
             }
         }
       else if (arg.is_complex_type ())
@@ -110,11 +110,11 @@
           FloatComplexHESS result (ctmp);
 
           if (nargout <= 1)
-            retval(0) = result.hess_matrix ();
+            retval = ovl (result.hess_matrix ());
           else
             {
-              retval(1) = result.hess_matrix ();
-              retval(0) = result.unitary_hess_matrix ();
+              retval = ovl (result.unitary_hess_matrix (),
+                            result.hess_matrix ());
             }
         }
     }
@@ -127,11 +127,11 @@
           HESS result (tmp);
 
           if (nargout <= 1)
-            retval(0) = result.hess_matrix ();
+            retval = ovl (result.hess_matrix ());
           else
             {
-              retval(1) = result.hess_matrix ();
-              retval(0) = result.unitary_hess_matrix ();
+              retval = ovl (result.unitary_hess_matrix (),
+                            result.hess_matrix ());
             }
         }
       else if (arg.is_complex_type ())
@@ -141,11 +141,11 @@
           ComplexHESS result (ctmp);
 
           if (nargout <= 1)
-            retval(0) = result.hess_matrix ();
+            retval = ovl (result.hess_matrix ());
           else
             {
-              retval(1) = result.hess_matrix ();
-              retval(0) = result.unitary_hess_matrix ();
+              retval = ovl (result.unitary_hess_matrix (),
+                            result.hess_matrix ());
             }
         }
       else
diff -r e429ddca0d51 libinterp/corefcn/mgorth.cc
--- a/libinterp/corefcn/mgorth.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/mgorth.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -98,8 +98,7 @@
           FloatComplexMatrix V = arg_v.float_complex_matrix_value ();
           FloatComplexRowVector h;
           do_mgorth (x, V, h);
-          retval(1) = h;
-          retval(0) = x;
+          retval = ovl (x, h);
         }
       else
         {
@@ -107,8 +106,7 @@
           FloatMatrix V = arg_v.float_matrix_value ();
           FloatRowVector h;
           do_mgorth (x, V, h);
-          retval(1) = h;
-          retval(0) = x;
+          retval = ovl (x, h);
         }
     }
   else
@@ -119,8 +117,7 @@
           ComplexMatrix V = arg_v.complex_matrix_value ();
           ComplexRowVector h;
           do_mgorth (x, V, h);
-          retval(1) = h;
-          retval(0) = x;
+          retval = ovl (x, h);
         }
       else
         {
@@ -128,8 +125,7 @@
           Matrix V = arg_v.matrix_value ();
           RowVector h;
           do_mgorth (x, V, h);
-          retval(1) = h;
-          retval(0) = x;
+          retval = ovl (x, h);
         }
     }
 
diff -r e429ddca0d51 libinterp/corefcn/quad.cc
--- a/libinterp/corefcn/quad.cc	Fri Dec 11 11:40:31 2015 -0500
+++ b/libinterp/corefcn/quad.cc	Sat Dec 12 20:20:40 2015 +0100
@@ -306,10 +306,7 @@
           break;
         }
 
-      retval(3) = abserr;
-      retval(2) = nfun;
-      retval(1) = ier;
-      retval(0) = val;
+      retval = ovl (val, ier, nfun, abserr);
 
     }
   else
@@ -401,10 +398,7 @@
           break;
         }
 
-      retval(3) = abserr;
-      retval(2) = nfun;
-      retval(1) = ier;
-      retval(0) = val;
+      retval = ovl (val, ier, nfun, abserr);
     }
 
   if (fcn_name.length ())
