diff --git a/Geo/GModelFactory.cpp b/Geo/GModelFactory.cpp
index abd70e301fa947b5fc929777175397c4d400930b..9b2d65edcafc871f3d774b5b42607bb635fdfb4d 100644
--- a/Geo/GModelFactory.cpp
+++ b/Geo/GModelFactory.cpp
@@ -129,7 +129,7 @@ GFace *GeoFactory::addPlanarFace(GModel *gm, std::vector< std::vector<GEdge *> >
       numl++;
       if (!FindEdgeLoop(numl)) break;
     }
-    sortEdgesInLoop(numl, temp);
+    sortEdgesInLoop(numl, temp, true);
     EdgeLoop *l = Create_EdgeLoop(numl, temp);
     vecLoops.push_back(l);
     Tree_Add(gm->getGEOInternals()->EdgeLoops, &l);
diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp
index 5b8d975deca6e119fc34904c0cec12be030b36b2..a8b0ab1165277221cc8f0e3ed53c2f1ff4550630 100644
--- a/Geo/Geo.cpp
+++ b/Geo/Geo.cpp
@@ -3468,7 +3468,7 @@ bool IntersectCurvesWithSurface(List_T *curve_ids, int surface_id, List_T *shape
 
 // Bunch of utility routines
 
-void sortEdgesInLoop(int num, List_T *edges)
+void sortEdgesInLoop(int num, List_T *edges, bool orient)
 {
   // This function sorts the edges in an EdgeLoop and detects any
   // subloops. Warning: the input edges are supposed to be *oriented*
@@ -3504,12 +3504,10 @@ void sortEdgesInLoop(int num, List_T *edges)
     for(int i = 0; i < List_Nbr(temp); i++) {
       c2 = *(Curve **)List_Pointer(temp, i);
        //reverse loop if not ordered correctly !
-      /*
-      if (c1->end == c2->end){
+      if (orient && c1->end == c2->end){
 	Curve *c2R = CreateReversedCurve(c2);
 	c2 = c2R;
       }
-      */
       if(c1->end == c2->beg) {
         List_Add(edges, &c2->Num);
         List_PSuppress(temp, i);
diff --git a/Geo/Geo.h b/Geo/Geo.h
index 10aa0f74ff47dda8f919f79337d9cc6225823a5b..e670cd0f623d048fc5330ab7f8492f25343c2990 100644
--- a/Geo/Geo.h
+++ b/Geo/Geo.h
@@ -310,7 +310,7 @@ int recognize_seg(int typ, List_T *liste, int *seg);
 int recognize_loop(List_T *liste, int *loop);
 int recognize_surfloop(List_T *liste, int *loop);
 
-void sortEdgesInLoop(int num, List_T *edges);
+void sortEdgesInLoop(int num, List_T *edges, bool orient=false);
 void setSurfaceGeneratrices(Surface *s, List_T *loops);
 void setVolumeSurfaces(Volume *v, List_T *loops);
 void setSurfaceEmbeddedPoints(Surface *s, List_T *points);
diff --git a/benchmarks/step/cube_filet.msh b/benchmarks/step/cube_filet.msh
index 3a49e2aa4ac4eee8a240210639280eeea7ac9445..053a9e75f9381822eb6549a74de2cddb8a6f79ce 100644
--- a/benchmarks/step/cube_filet.msh
+++ b/benchmarks/step/cube_filet.msh
@@ -129,11 +129,11 @@ $Nodes
 124 5.724399909650009 4.057293309178489 3.187989940240517
 125 5.297025541818572 5.337296870855169 97.49274520954476
 126 4.057460557807088 94.2756124685302 3.18785180747434
-127 4.448596461323688 4.893939737695014 96.56582571718759
-128 95.78244796844946 4.846391383347251 96.32484100341955
-129 97.03607392997444 2.894110636103731 42.08487531491071
-130 3.234590039133448 15.32605331331894 97.36404970525102
-131 96.92749006787444 15.17103119663408 97.21178766738879
+127 4.448596461323718 4.893939737694987 96.56582571718761
+128 95.7824479684494 4.84639138334719 96.32484100341956
+129 97.03607392997444 2.894110636103737 42.08487531491069
+130 3.234590039133403 15.326053313319 97.36404970525098
+131 96.92749006787444 15.171031196634 97.21178766738879
 $EndNodes
 $Elements
 458
@@ -331,10 +331,10 @@ $Elements
 192 1 2 0 74 27 27
 193 2 2 0 1 41 43 44
 194 2 2 0 1 41 42 43
-195 2 2 0 1 1 42 41
-196 2 2 0 1 41 44 2
-197 2 2 0 1 42 3 43
-198 2 2 0 1 44 43 4
+195 2 2 0 1 41 44 2
+196 2 2 0 1 42 3 43
+197 2 2 0 1 44 43 4
+198 2 2 0 1 1 42 41
 199 2 2 0 2 5 119 45
 200 2 2 0 2 2 44 46
 201 2 2 0 2 5 46 119
@@ -343,13 +343,13 @@ $Elements
 204 2 2 0 2 4 45 119
 205 2 2 0 3 51 47 48
 206 2 2 0 3 53 50 45
-207 2 2 0 3 49 52 48
-208 2 2 0 3 52 51 48
+207 2 2 0 3 52 51 48
+208 2 2 0 3 49 52 48
 209 2 2 0 3 6 47 51
 210 2 2 0 3 4 53 45
 211 2 2 0 3 47 7 48
-212 2 2 0 3 45 50 5
-213 2 2 0 3 49 50 52
+212 2 2 0 3 49 50 52
+213 2 2 0 3 45 50 5
 214 2 2 0 3 50 53 52
 215 2 2 0 4 8 120 54
 216 2 2 0 4 47 55 7
@@ -359,9 +359,9 @@ $Elements
 220 2 2 0 4 6 54 120
 221 2 2 0 5 59 56 57
 222 2 2 0 5 59 57 58
-223 2 2 0 5 59 9 56
-224 2 2 0 5 59 58 12
-225 2 2 0 5 56 10 57
+223 2 2 0 5 59 58 12
+224 2 2 0 5 56 10 57
+225 2 2 0 5 59 9 56
 226 2 2 0 5 58 57 11
 227 2 2 0 6 13 121 60
 228 2 2 0 6 10 56 61
@@ -369,48 +369,48 @@ $Elements
 230 2 2 0 6 56 121 61
 231 2 2 0 6 9 121 56
 232 2 2 0 6 9 60 121
-233 2 2 0 7 63 62 46
-234 2 2 0 7 63 58 62
-235 2 2 0 7 58 11 62
+233 2 2 0 7 63 58 62
+234 2 2 0 7 63 62 46
+235 2 2 0 7 46 62 2
 236 2 2 0 7 63 46 5
-237 2 2 0 7 46 62 2
+237 2 2 0 7 58 11 62
 238 2 2 0 7 63 12 58
 239 2 2 0 8 66 65 55
 240 2 2 0 8 66 64 65
 241 2 2 0 8 66 14 64
 242 2 2 0 8 66 55 8
-243 2 2 0 8 55 65 7
-244 2 2 0 8 64 15 65
+243 2 2 0 8 64 15 65
+244 2 2 0 8 55 65 7
 245 2 2 0 9 68 69 67
 246 2 2 0 9 68 67 54
-247 2 2 0 9 68 17 69
-248 2 2 0 9 6 68 54
+247 2 2 0 9 6 68 54
+248 2 2 0 9 54 67 8
 249 2 2 0 9 69 16 67
-250 2 2 0 9 54 67 8
+250 2 2 0 9 68 17 69
 251 2 2 0 10 71 72 70
 252 2 2 0 10 71 70 69
-253 2 2 0 10 72 18 70
-254 2 2 0 10 19 72 71
-255 2 2 0 10 69 70 16
-256 2 2 0 10 71 69 17
+253 2 2 0 10 19 72 71
+254 2 2 0 10 71 69 17
+255 2 2 0 10 72 18 70
+256 2 2 0 10 69 70 16
 257 2 2 0 11 73 74 75
 258 2 2 0 11 73 75 42
-259 2 2 0 11 42 75 3
-260 2 2 0 11 1 73 42
-261 2 2 0 11 74 21 75
-262 2 2 0 11 20 74 73
+259 2 2 0 11 74 21 75
+260 2 2 0 11 20 74 73
+261 2 2 0 11 1 73 42
+262 2 2 0 11 42 75 3
 263 2 2 0 12 79 76 77
 264 2 2 0 12 79 77 78
-265 2 2 0 12 76 22 77
-266 2 2 0 12 79 78 25
+265 2 2 0 12 79 78 25
+266 2 2 0 12 76 22 77
 267 2 2 0 12 78 77 24
 268 2 2 0 12 79 23 76
-269 2 2 0 13 82 78 80
-270 2 2 0 13 82 80 81
-271 2 2 0 13 82 25 78
-272 2 2 0 13 81 80 26
-273 2 2 0 13 78 24 80
-274 2 2 0 13 82 81 20
+269 2 2 0 13 82 80 81
+270 2 2 0 13 82 78 80
+271 2 2 0 13 82 81 20
+272 2 2 0 13 78 24 80
+273 2 2 0 13 82 25 78
+274 2 2 0 13 81 80 26
 275 2 2 0 14 21 122 83
 276 2 2 0 14 81 74 20
 277 2 2 0 14 21 74 122
@@ -419,13 +419,13 @@ $Elements
 280 2 2 0 14 26 83 122
 281 2 2 0 15 88 84 85
 282 2 2 0 15 90 87 83
-283 2 2 0 15 88 86 89
-284 2 2 0 15 87 90 89
-285 2 2 0 15 88 85 86
-286 2 2 0 15 26 90 83
-287 2 2 0 15 84 19 85
-288 2 2 0 15 88 27 84
-289 2 2 0 15 86 87 89
+283 2 2 0 15 26 90 83
+284 2 2 0 15 88 85 86
+285 2 2 0 15 90 86 87
+286 2 2 0 15 89 86 90
+287 2 2 0 15 88 27 84
+288 2 2 0 15 88 86 89
+289 2 2 0 15 84 19 85
 290 2 2 0 15 83 87 21
 291 2 2 0 16 92 91 28
 292 2 2 0 16 91 76 23
@@ -435,10 +435,10 @@ $Elements
 296 2 2 0 16 22 123 92
 297 2 2 0 17 96 93 94
 298 2 2 0 17 96 94 95
-299 2 2 0 17 93 30 94
-300 2 2 0 17 96 95 32
-301 2 2 0 17 96 29 93
-302 2 2 0 17 95 94 31
+299 2 2 0 17 96 95 32
+300 2 2 0 17 96 29 93
+301 2 2 0 17 95 94 31
+302 2 2 0 17 93 30 94
 303 2 2 0 18 33 124 97
 304 2 2 0 18 93 98 30
 305 2 2 0 18 33 98 124
@@ -447,37 +447,37 @@ $Elements
 308 2 2 0 18 29 97 124
 309 2 2 0 19 101 95 99
 310 2 2 0 19 101 99 100
-311 2 2 0 19 101 32 95
-312 2 2 0 19 101 100 27
-313 2 2 0 19 100 99 18
-314 2 2 0 19 95 31 99
+311 2 2 0 19 100 99 18
+312 2 2 0 19 95 31 99
+313 2 2 0 19 101 100 27
+314 2 2 0 19 101 32 95
 315 2 2 0 20 105 97 102
 316 2 2 0 20 107 104 92
-317 2 2 0 20 103 106 102
-318 2 2 0 20 106 105 102
-319 2 2 0 20 97 29 102
-320 2 2 0 20 28 107 92
-321 2 2 0 20 33 97 105
-322 2 2 0 20 103 104 106
-323 2 2 0 20 104 107 106
-324 2 2 0 20 92 104 22
+317 2 2 0 20 33 97 105
+318 2 2 0 20 103 106 102
+319 2 2 0 20 106 103 104
+320 2 2 0 20 97 29 102
+321 2 2 0 20 106 105 102
+322 2 2 0 20 28 107 92
+323 2 2 0 20 92 104 22
+324 2 2 0 20 107 106 104
 325 2 2 0 21 110 91 108
 326 2 2 0 21 110 108 109
-327 2 2 0 21 110 28 91
-328 2 2 0 21 91 23 108
+327 2 2 0 21 91 23 108
+328 2 2 0 21 109 108 34
 329 2 2 0 21 110 109 35
-330 2 2 0 21 109 108 34
+330 2 2 0 21 110 28 91
 331 2 2 0 22 111 98 112
 332 2 2 0 22 111 112 113
-333 2 2 0 22 98 33 112
-334 2 2 0 22 30 98 111
-335 2 2 0 22 36 111 113
-336 2 2 0 22 113 112 37
+333 2 2 0 22 30 98 111
+334 2 2 0 22 98 33 112
+335 2 2 0 22 113 112 37
+336 2 2 0 22 36 111 113
 337 2 2 0 23 116 114 115
 338 2 2 0 23 116 115 64
-339 2 2 0 23 64 115 15
-340 2 2 0 23 114 38 115
-341 2 2 0 23 116 64 14
+339 2 2 0 23 116 64 14
+340 2 2 0 23 64 115 15
+341 2 2 0 23 114 38 115
 342 2 2 0 23 116 39 114
 343 2 2 0 24 40 118 117
 344 2 2 0 24 117 114 39
@@ -503,9 +503,9 @@ $Elements
 364 2 2 0 1001 23 22 28
 365 2 2 0 1001 29 30 33
 366 2 2 0 1001 7 8 6
-367 2 2 0 1001 5 4 2
-368 2 2 0 1001 10 128 131
-369 2 2 0 1001 39 130 127
+367 2 2 0 1001 2 5 4
+368 2 2 0 1001 128 131 10
+369 2 2 0 1001 127 39 130
 370 2 2 0 1001 108 110 129
 371 2 2 0 1001 38 118 127
 372 2 2 0 1001 13 60 128
@@ -514,85 +514,85 @@ $Elements
 375 2 2 0 1001 40 127 118
 376 2 2 0 1001 13 128 61
 377 2 2 0 1001 39 127 117
-378 2 2 0 1001 9 131 128
-379 2 2 0 1001 38 127 130
+378 2 2 0 1001 128 9 131
+379 2 2 0 1001 127 130 38
 380 2 2 0 1001 40 117 127
 381 2 2 0 1001 34 129 109
 382 2 2 0 1001 35 109 129
-383 2 2 0 1001 75 20 73
-384 2 2 0 1001 96 30 29
-385 2 2 0 1001 94 30 96
-386 2 2 0 1001 38 130 115
-387 2 2 0 1001 103 102 105
-388 2 2 0 1001 71 18 19
-389 2 2 0 1001 33 30 112
-390 2 2 0 1001 10 131 57
-391 2 2 0 1001 9 59 131
-392 2 2 0 1001 63 2 62
-393 2 2 0 1001 77 23 79
-394 2 2 0 1001 17 70 71
-395 2 2 0 1001 85 19 27
-396 2 2 0 1001 110 23 28
-397 2 2 0 1001 26 21 87
-398 2 2 0 1001 65 8 7
-399 2 2 0 1001 80 20 26
-400 2 2 0 1001 22 23 77
-401 2 2 0 1001 104 28 22
-402 2 2 0 1001 107 28 104
-403 2 2 0 1001 27 18 101
-404 2 2 0 1001 50 49 53
-405 2 2 0 1001 5 2 63
-406 2 2 0 1001 101 18 99
-407 2 2 0 1001 49 48 51
-408 2 2 0 1001 21 20 75
-409 2 2 0 1001 66 8 65
-410 2 2 0 1001 108 23 110
-411 2 2 0 1001 112 30 111
-412 2 2 0 1001 39 116 130
-413 2 2 0 1001 70 18 71
-414 2 2 0 1001 82 20 80
-415 2 2 0 1001 87 86 90
-416 2 2 0 1001 90 86 89
-417 2 2 0 1001 112 113 37
-418 2 2 0 1001 111 36 113
-419 2 2 0 1001 62 11 12
-420 2 2 0 1001 63 62 12
-421 2 2 0 1001 73 1 3
-422 2 2 0 1001 75 73 3
-423 2 2 0 1001 15 14 66
+383 2 2 0 1001 70 18 71
+384 2 2 0 1001 26 21 87
+385 2 2 0 1001 102 33 105
+386 2 2 0 1001 108 23 110
+387 2 2 0 1001 21 20 75
+388 2 2 0 1001 29 33 102
+389 2 2 0 1001 94 30 96
+390 2 2 0 1001 63 62 12
+391 2 2 0 1001 3 1 43
+392 2 2 0 1001 62 11 12
+393 2 2 0 1001 107 28 104
+394 2 2 0 1001 63 2 62
+395 2 2 0 1001 10 131 57
+396 2 2 0 1001 65 8 7
+397 2 2 0 1001 43 1 41
+398 2 2 0 1001 101 18 99
+399 2 2 0 1001 71 18 19
+400 2 2 0 1001 112 30 111
+401 2 2 0 1001 33 30 112
+402 2 2 0 1001 82 20 80
+403 2 2 0 1001 111 36 113
+404 2 2 0 1001 49 48 51
+405 2 2 0 1001 104 28 22
+406 2 2 0 1001 67 16 68
+407 2 2 0 1001 22 23 77
+408 2 2 0 1001 50 49 53
+409 2 2 0 1001 5 2 63
+410 2 2 0 1001 73 1 3
+411 2 2 0 1001 80 20 26
+412 2 2 0 1001 75 73 3
+413 2 2 0 1001 77 23 79
+414 2 2 0 1001 27 18 101
+415 2 2 0 1001 110 23 28
+416 2 2 0 1001 66 8 65
+417 2 2 0 1001 15 14 66
+418 2 2 0 1001 96 30 29
+419 2 2 0 1001 75 20 73
+420 2 2 0 1001 9 59 131
+421 2 2 0 1001 39 116 130
+422 2 2 0 1001 112 113 37
+423 2 2 0 1001 68 16 17
 424 2 2 0 1001 15 66 65
-425 2 2 0 1001 102 33 105
-426 2 2 0 1001 6 8 68
-427 2 2 0 1001 68 8 67
-428 2 2 0 1001 29 33 102
-429 2 2 0 1001 41 2 43
-430 2 2 0 1001 43 2 4
-431 2 2 0 1001 17 16 70
-432 2 2 0 1001 103 105 106
-433 2 2 0 1001 67 16 68
-434 2 2 0 1001 68 16 17
-435 2 2 0 1001 4 5 53
-436 2 2 0 1001 53 5 50
-437 2 2 0 1001 48 7 51
-438 2 2 0 1001 51 7 6
-439 2 2 0 1001 86 85 89
-440 2 2 0 1001 89 85 88
-441 2 2 0 1001 99 31 101
-442 2 2 0 1001 101 31 32
-443 2 2 0 1001 116 14 115
-444 2 2 0 1001 115 14 15
-445 2 2 0 1001 24 25 80
-446 2 2 0 1001 80 25 82
-447 2 2 0 1001 12 11 59
-448 2 2 0 1001 59 11 57
-449 2 2 0 1001 79 25 77
-450 2 2 0 1001 77 25 24
-451 2 2 0 1001 32 31 96
-452 2 2 0 1001 96 31 94
-453 2 2 0 1001 106 107 103
-454 2 2 0 1001 103 107 104
-455 2 2 0 1001 34 108 129
-456 2 2 0 1001 35 129 110
-457 2 2 0 1001 3 1 43
-458 2 2 0 1001 43 1 41
+425 2 2 0 1001 17 70 71
+426 2 2 0 1001 85 19 27
+427 2 2 0 1001 103 102 105
+428 2 2 0 1001 103 105 106
+429 2 2 0 1001 17 16 70
+430 2 2 0 1001 41 2 43
+431 2 2 0 1001 43 2 4
+432 2 2 0 1001 53 5 50
+433 2 2 0 1001 6 8 68
+434 2 2 0 1001 68 8 67
+435 2 2 0 1001 48 7 51
+436 2 2 0 1001 51 7 6
+437 2 2 0 1001 38 130 115
+438 2 2 0 1001 99 31 101
+439 2 2 0 1001 101 31 32
+440 2 2 0 1001 116 14 115
+441 2 2 0 1001 115 14 15
+442 2 2 0 1001 24 25 80
+443 2 2 0 1001 80 25 82
+444 2 2 0 1001 90 87 89
+445 2 2 0 1001 89 87 86
+446 2 2 0 1001 12 11 59
+447 2 2 0 1001 59 11 57
+448 2 2 0 1001 79 25 77
+449 2 2 0 1001 77 25 24
+450 2 2 0 1001 32 31 96
+451 2 2 0 1001 96 31 94
+452 2 2 0 1001 89 86 88
+453 2 2 0 1001 88 86 85
+454 2 2 0 1001 106 107 103
+455 2 2 0 1001 103 107 104
+456 2 2 0 1001 4 5 53
+457 2 2 0 1001 34 108 129
+458 2 2 0 1001 35 129 110
 $EndElements