diff --git a/glmrand.cc b/glmrand.cc
index 9c2fb9166a3941f05376d905918be6a835791ef6..6ab42f24fc68ea6dd4849acb2b05bd834d4713d2 100644
--- a/glmrand.cc
+++ b/glmrand.cc
@@ -185,13 +185,15 @@ namespace SIGPROC {
 	      // e is the estimate of the variance of the timeseries, sigma^2
 	      Matrix varmat = (r.Columns(batch_pos, numrand+1).t()*r.Columns(batch_pos, numrand+1))*var_on_e/sizeTS;
 	      ColumnVector vartemp;
-	      getdiag(vartemp, varmat);
+	      //getdiag(vartemp, varmat);  // obsolete fn
+	      vartemp = diag(varmat);  // MJ NOTE: new fn
 	      var.Rows(batch_pos, numrand+1) = vartemp;
 	    }      
 	  else
 	    {
 	      varmatfull = (r.Columns(batch_pos, batch_pos+batch_size-1).t()*r.Columns(batch_pos, batch_pos+batch_size-1))*var_on_e/sizeTS;
-	      getdiag(vartempfull, varmatfull);
+	      //getdiag(vartempfull, varmatfull);  // obsolete fn
+	      vartempfull = diag(varmatfull);  // MJ NOTE: new fn
 	      var.Rows(batch_pos, batch_pos+batch_size-1) = vartempfull;
 	    }
 	  batch_pos += batch_size;