 
         // #0
         uint w0 = v1;
-        uint w1 = vNew0;
-        uint w2 = vNew1;
+        uint w1 = vNew1;
+        uint w2 = vNew0;
 
         // This neighbor has to be determined by comparing vertex indices
+         uint subDivCntN1 = subdivCnt_D[oldN1];
+         if (subDivCntN1 > 0) {
+             for (int i = 0; i < subDivCntN1; ++i) {
+                 uint u0, u1, u2;
+                 u0 = newTriangles_D[3*(newTriangleIdxOffsets[oldN1]+i)+0];
+                 u1 = newTriangles_D[3*(newTriangleIdxOffsets[oldN1]+i)+1];
+                 u2 = newTriangles_D[3*(newTriangleIdxOffsets[oldN1]+i)+2];
+                 if (hasAdjEdge_D (w0, w1, w2, u0, u1, u2)) {
+                     newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+0]=
+                             numberOfKeptTriangles + newTriangleIdxOffsets[oldN1]+i;
+                 }
+             }
+         } else {
+             newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+0] =
+                     oldTriangleIdxOffset[oldN1];
+         }
+
+         // This neighbor is the other subdivision
+         newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+1] =
+                 numberOfKeptTriangles+triIdxOffs + 1;
+
+         // This neighbor has to be determined by comparing vertex indices
          uint subDivCntN0 = subdivCnt_D[oldN0];
          if (subDivCntN0 > 0) {
              for (int i = 0; i < subDivCntN0; ++i) {

                 u1 = newTriangles_D[3*(newTriangleIdxOffsets[oldN0]+i)+1];
                 u2 = newTriangles_D[3*(newTriangleIdxOffsets[oldN0]+i)+2];
                 if (hasAdjEdge_D (w0, w1, w2, u0, u1, u2)) {
                     newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+0]=
                             numberOfKeptTriangles + newTriangleIdxOffsets[oldN0]+i;
                 }
             }
         } else {
             newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+0] =
                     oldTriangleIdxOffset[oldN0];
         }

         // This neighbor is the other subdivision
         newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+1] =
                 numberOfKeptTriangles+triIdxOffs + 1;

         // This neighbor has to be determined by comparing vertex indices
         uint subDivCntN1 = subdivCnt_D[oldN1];
         if (subDivCntN1 > 0) {
             for (int i = 0; i < subDivCntN1; ++i) {
                 uint u0, u1, u2;
                 u0 = newTriangles_D[3*(newTriangleIdxOffsets[oldN1]+i)+0];
                 u1 = newTriangles_D[3*(newTriangleIdxOffsets[oldN1]+i)+1];
                 u2 = newTriangles_D[3*(newTriangleIdxOffsets[oldN1]+i)+2];
                 if (hasAdjEdge_D (w0, w1, w2, u0, u1, u2)) {
                     newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+2]=
                             numberOfKeptTriangles + newTriangleIdxOffsets[oldN1]+i;
                 }
             }
         } else {
             newTriangleNeighbors_D[3*(numberOfKeptTriangles+triIdxOffs)+2]=
                     oldTriangleIdxOffset[oldN1];
         }





    } else if (flag0 && !flag1 && flag2) { // 3 new triangles have been spawned

        // Get index of neighbors of old triangle
        uint oldN0 = oldTriangleNeighbors_D[3*idx+0];
