diff --git a/crpptbx/TCV/gdat_tcv.m b/crpptbx/TCV/gdat_tcv.m
index ea4ed7ad95ca5979424c73289eaa812cbc8c568a..0761ac1127c25f9898263e140b2f1e57b3789798 100644
--- a/crpptbx/TCV/gdat_tcv.m
+++ b/crpptbx/TCV/gdat_tcv.m
@@ -1219,6 +1219,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
     
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    case {'sxr', 'mpx'}
+
     if strcmp(data_request_eff,'mpx')
       data_request_eff = 'mpx'; % mpx chosen through parameter 'source' within 'sxr'
       gdat_data.data_request = data_request_eff;
diff --git a/crpptbx/gdat.m b/crpptbx/gdat.m
index 5d40f667246d50333789ca5af002179ffaf2cc61..37dd7ef1ec9b2b0c6fc30ad3f079faf0e12765a4 100644
--- a/crpptbx/gdat.m
+++ b/crpptbx/gdat.m
@@ -77,6 +77,7 @@ if nargin>2
   end
 end
 
+gdat_data.data = [];
 % construct default parameters structure
 gdat_params.data_request = '';
 fusion_machine_defaultname=getenv('FUSION_MACHINE_DEFAULTNAME');
@@ -122,6 +123,7 @@ gdat_path = mfilename('fullpath');
 eval(['addpath ' gdat_path(1:end-4) upper(machine_eff)]);
 
 % copy gdat present call:
+gdat_data.gdat_call = [];
 if nargin==0
   subcall=['gdat;'];
 elseif nargin>=1
@@ -150,7 +152,15 @@ elseif nargin>=1
   subcall = [subcall ');'];
 end
 
+gdat_data.gdat_call = [subcall ' % nargout = ' num2str(nargout)];
+gdat_data.gdat_params = gdat_params;
+if ~isfield(gdat_data.gdat_params,'doplot')
+  gdat_data.gdat_params.doplot = 0;
+end
+
 % Note: would need to check nargout to make call consistent, but to avoid this, each gdat_xxx should return at least an empty varargout: varargout{1}=cell(1);
+% copy subcall here so is last subnode
+
 try
   if nargin==0
     eval(['[gdat_data,gdat_params,error_status,varargout] = gdat_' lower(machine_eff) ';']);
@@ -166,13 +176,6 @@ catch
   return
 end
 
-% copy subcall here so is last subnode
-gdat_data.gdat_call = [subcall ' % nargout = ' num2str(nargout)];
-
-if ~isfield(gdat_data.gdat_params,'doplot')
-  gdat_data.gdat_params.doplot = 0;
-end
-
 if gdat_data.gdat_params.doplot
   % plot gdat_data versus 1st dim by default, if nb_dims<=2, otherwise do not plot
   if length(varargout)==0 || isempty(varargout{1})