diff --git a/src/Grid/grid_dist_id.hpp b/src/Grid/grid_dist_id.hpp
index 452fcc65738f59835b9ed0a55a7997b61bb0c9f6..b531a8c6005ddd0f4601ff25456d003ec1f0d05a 100644
--- a/src/Grid/grid_dist_id.hpp
+++ b/src/Grid/grid_dist_id.hpp
@@ -301,7 +301,7 @@ class grid_dist_id
 
 		if (init_local_i_g_box == true)	return;
 
-		// Get the number of near processors
+		// Get the number of sub-domains
 		for (size_t i = 0 ; i < dec.getNSubDomain() ; i++)
 		{
 			loc_ig_box.add();
diff --git a/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp b/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp
index 89656d481a5ad80a3631a0357d71cc06d624499d..8875f55221bdb99ff2a2b000b645934e4cbf7869 100644
--- a/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp
+++ b/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp
@@ -147,7 +147,7 @@ void Test3D_unb_ghost_periodic(const Box<3,float> & domain, long int k)
 		sz[2] = k;
 
 		// Ghost
-		Ghost<3,float> g(0.1);
+		Ghost<3,float> g(0.491);
 
 		// periodicity
 		periodicity<3> pr = {{PERIODIC,PERIODIC,PERIODIC}};
@@ -219,6 +219,9 @@ void Test3D_unb_ghost_periodic(const Box<3,float> & domain, long int k)
 			auto key = dom_gi.get();
 			auto key_g = g_dist.getGKey(key);
 
+			// Return the boxes containing the grids
+			auto & gb = dom_gi.getGBoxes();
+
 			// transform the key to be periodic
 			for (size_t i = 0 ; i < 3 ; i++)
 			{
@@ -231,8 +234,25 @@ void Test3D_unb_ghost_periodic(const Box<3,float> & domain, long int k)
 			if (g_dist.template get<0>(key) != -1 && out_p == true)
 				out_cnt++;
 
-			if ( g_dist.template get<0>(key) != -1 && info.LinId(key_g) != g_dist.template get<0>(key) )
-				match &= false;
+			// The last points can be invalid because of rounding off problems
+			bool can_invalid = false;
+			if (key.getKey().get(0) == 0 || key.getKey().get(1) == 0 || key.getKey().get(2) == 0)
+				can_invalid = true;
+			else if (key.getKey().get(0) == gb.get(key.getSub()).GDbox.getHigh(0) ||
+					 key.getKey().get(1) == gb.get(key.getSub()).GDbox.getHigh(1) ||
+					 key.getKey().get(2) == gb.get(key.getSub()).GDbox.getHigh(2))
+				can_invalid = true;
+
+			if (can_invalid == true)
+			{
+				if ( g_dist.template get<0>(key) != -1 && info.LinId(key_g) != g_dist.template get<0>(key) )
+					match &= false;
+			}
+			else
+			{
+				if (info.LinId(key_g) != g_dist.template get<0>(key) )
+					match &= false;
+			}
 
 			++dom_gi;
 		}