diff --git a/crp.m b/crp.m
index c694e85edd0c240196cfc3eb8ee479bd2e19031d..354f05ab7da65a2f8497c738bf8b36a72ca9702f 100644
--- a/crp.m
+++ b/crp.m
@@ -79,6 +79,9 @@ function xout=crp(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 5.4  2005/11/09 08:58:13  marwan
+% bug fix in interdependent neighbours method
+%
 % Revision 5.3  2005/06/15 15:16:00  marwan
 % RP matrix transposed for "interdependent neighbourhood"
 %
@@ -700,10 +703,11 @@ switch(action)
         JJy((JJy(1:mine,i)>min(NX,NY)),i)=i;
         X(i,JJx(1:mine,i)) = (sy(i,JJx(1:mine,i))<=ey(i))';
         if check_stop(hCRP,hCtrl,nogui,obj), return, end
-        X(i,JJy(1:mine,i)) = (sx(i,JJy(1:mine,i))<=ex(i))';
+%        X(i,JJy(1:mine,i)) = (sx(i,JJy(1:mine,i))<=ex(i))';
       end
 
       clear X1 SS* JJ* s sx sy s1 px py ex ey
+      X = X';
       matext=[num2str(round(1000*mine/NY)/10) '% (interdependent neighbours)'];
 
 
@@ -813,6 +817,7 @@ switch(action)
      Shuttle.t=t;
      Shuttle.cm=cm;
      Shuttle.txt_cross=txt_cross;
+     if isempty(X), warning(['Uuups! Empty matrix.',10,'I give up ...']); return; end
      show_crp(X,Shuttle)
   else
     if nargout==1, xout=X;end
diff --git a/crp2.m b/crp2.m
index 38aa31bd8731f7d92a4a972e2c7da6673240f06e..68e49e354958c971f2599f4c1749f5f69f3ffe8c 100644
--- a/crp2.m
+++ b/crp2.m
@@ -81,6 +81,9 @@ function xout=crp2(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 5.4  2005/11/09 08:58:13  marwan
+% bug fix in interdependent neighbours method
+%
 % Revision 5.3  2005/09/02 08:02:57  marwan
 % line fitting algorithm improved (linear interpolation between set points)
 %
@@ -1170,6 +1173,7 @@ switch(action)
      Shuttle.t=t;
      Shuttle.cm=cm;
      Shuttle.txt_cross=txt_cross;
+     if isempty(X), warning(['Uuups! Empty matrix.',10,'I give up ...']); return; end
      show_crp(X,Shuttle)
  else
    if nargout==1, xout=X; end
@@ -1571,7 +1575,7 @@ set(0,'ShowHidden','Off')
 
 %%%%%%% error handling
 
-%if 0
+% if 0
 catch
   try, if nogui==0
     for i=1:length(obj.enable), set(obj.children(i),'Enable',obj.enable{i}); end
diff --git a/crp_big.m b/crp_big.m
index 8e6272e4e4e18af45097dedfa1ddad4d030e5710..624dc9b9ae189390b17c76a9c8728adc2291c0d1 100644
--- a/crp_big.m
+++ b/crp_big.m
@@ -77,6 +77,9 @@ function xout=crp_big(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 5.4  2005/11/09 08:58:13  marwan
+% bug fix in interdependent neighbours method
+%
 % Revision 5.3  2005/06/15 15:16:00  marwan
 % RP matrix transposed for "interdependent neighbourhood"
 %
@@ -742,6 +745,7 @@ switch(action)
                       X(:,NX0+1:end)=[];
                       NX=NX0; NY=NY0;
                       clear X1 SS* JJ* s sx sy s1 px py eex eey
+                      X = X';
                       matext=[num2str(round(1000*e)/10) '% (interdependent neighbours)'];
 
 
@@ -867,6 +871,7 @@ switch(action)
      Shuttle.t=t;
      Shuttle.cm=cm;
      Shuttle.txt_cross=txt_cross;
+     if isempty(X), warning(['Uuups! Empty matrix.',10,'I give up ...']); return; end
      show_crp(X,Shuttle)
  else
    if nargout==1, xout=X;end