diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp
index 6d2b3a96fb..b44068908f 100644
--- a/pcbnew/class_board_item.cpp
+++ b/pcbnew/class_board_item.cpp
@@ -144,7 +144,10 @@ bool BOARD_ITEM::ptr_cmp::operator() ( const BOARD_ITEM* a, const BOARD_ITEM* b
     if( a->GetLayer() != b->GetLayer() )
         return a->GetLayer() < b->GetLayer();
 
-    return a->m_Uuid < b->m_Uuid;
+    if( a->m_Uuid != b->m_Uuid )    // shopuld be always the case foer valid boards
+        return a->m_Uuid < b->m_Uuid;
+
+    return a < b;
 }
 
 
diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp
index a7708fd844..c049776d85 100644
--- a/pcbnew/class_module.cpp
+++ b/pcbnew/class_module.cpp
@@ -1755,7 +1755,10 @@ bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITE
             return dwgA->GetShape() < dwgB->GetShape();
     }
 
-    return aFirst->m_Uuid < aSecond->m_Uuid;
+    if( aFirst->m_Uuid != aSecond->m_Uuid ) // shopuld be always the case foer valid boards
+        return aFirst->m_Uuid < aSecond->m_Uuid;
+
+    return aFirst < aSecond;
 }
 
 
@@ -1764,7 +1767,10 @@ bool MODULE::cmp_pads::operator()( const D_PAD* aFirst, const D_PAD* aSecond ) c
     if( aFirst->GetName() != aSecond->GetName() )
         return StrNumCmp( aFirst->GetName(), aSecond->GetName() ) < 0;
 
-    return aFirst->m_Uuid < aSecond->m_Uuid;
+    if( aFirst->m_Uuid != aSecond->m_Uuid ) // shopuld be always the case foer valid boards
+        return aFirst->m_Uuid < aSecond->m_Uuid;
+
+    return aFirst < aSecond;
 }
 
 
diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp
index e89ccea3a1..eff1c8ba25 100644
--- a/pcbnew/class_track.cpp
+++ b/pcbnew/class_track.cpp
@@ -968,7 +968,10 @@ bool TRACK::cmp_tracks::operator() ( const TRACK* a, const TRACK* b ) const
     if( a->Type() != b->Type() )
         return a->Type() < b->Type();
 
-    return a->m_Uuid < b->m_Uuid;
+    if( a->m_Uuid != b->m_Uuid )
+        return a->m_Uuid < b->m_Uuid;
+
+    return a < b;
 }