diff --git a/dev/demo/relationsdemo.js b/dev/demo/relationsdemo.js
index ef13cff..5faa359 100644
--- a/dev/demo/relationsdemo.js
+++ b/dev/demo/relationsdemo.js
@@ -136,6 +136,7 @@
  */
 
 relSnippet =
+// var relSnippetSimple =
   "<span class=\"context-left\"></span>" +
   "<span class=\"match\">" +
   "  <span xml:id=\"token-1\">" +
diff --git a/dev/js/src/match/relations.js b/dev/js/src/match/relations.js
index 1451c1e..942acee 100644
--- a/dev/js/src/match/relations.js
+++ b/dev/js/src/match/relations.js
@@ -69,15 +69,16 @@
         if (target != undefined) {
 
           // Check if the source is a span anchor
+          /*
           var start = edge.srcStart;
           if (start !== edge.srcEnd) {
             start = [start, edge.srcEnd];
           };
-
+          */
           
           // Add relation
           var relation = {
-            start : start,
+            start : [edge.srcStart, edge.srcEnd],
             end : target,
             direction : 'uni',
             label : edge.label
@@ -421,58 +422,74 @@
 
         // Check for long anchors
         if (v.start instanceof Array) {
-          var middle = Math.ceil(Math.abs(v.start[1] - v.start[0]) / 2) + v.start[0];
 
-          // Calculate signature to avoid multiple anchors
-          var anchorSig = "#" + v.start[0] + "_" + v.start[1];
-          if (v.start[0] > v.start[1]) {
-            anchorSig = "#" + v.start[1] + "_" + v.start[0];
-          };
+          if (v.start[0] == v.start[1]) {
+            v.start = v.start[0];
+          }
 
-          // Check if the anchor already exist
-          var anchor = anchors[anchorSig];
-          if (anchor === undefined) {
-            anchor = {
-              "first":   v.start[0],
-              "last" :   v.start[1],
-              "length" : v.start[1] - v.start[0]
+          else {
+          
+            var middle = Math.ceil(Math.abs(v.start[1] - v.start[0]) / 2) + v.start[0];
+
+            // Calculate signature to avoid multiple anchors
+            var anchorSig = "#" + v.start[0] + "_" + v.start[1];
+            if (v.start[0] > v.start[1]) {
+              anchorSig = "#" + v.start[1] + "_" + v.start[0];
             };
-            anchors[anchorSig] = anchor;
-            // anchors.push(v.startAnchor);
+            
+            // Check if the anchor already exist
+            var anchor = anchors[anchorSig];
+            if (anchor === undefined) {
+              anchor = {
+                "first":   v.start[0],
+                "last" :   v.start[1],
+                "length" : v.start[1] - v.start[0]
+              };
+              anchors[anchorSig] = anchor;
+              // anchors.push(v.startAnchor);
+            };
+
+            v.startAnchor = anchor;
+
+            // Add to anchors list
+            v.start = middle;
           };
-
-          v.startAnchor = anchor;
-
-          // Add to anchors list
-          v.start = middle;
         };
 
         if (v.end instanceof Array) {
-          var middle = Math.abs(v.end[0] - v.end[1]) + v.end[0];
 
-          // Calculate signature to avoid multiple anchors
-          var anchorSig = "#" + v.end[0] + "_" + v.end[1];
-          if (v.end[0] > v.end[1]) {
-            anchorSig = "#" + v.end[1] + "_" + v.end[0];
-          };
+          if (v.end[0] == v.end[1]) {
+            v.end = v.end[0];
+          }
 
-          // Check if the anchor already exist
-          var anchor = anchors[anchorSig];
-          if (anchor === undefined) {
-            anchor = {
-              "first":   v.end[0],
-              "last" :   v.end[1],
-              "length" : v.end[1] - v.end[0]
+          else {
+
+            var middle = Math.abs(v.end[0] - v.end[1]) + v.end[0];
+
+            // Calculate signature to avoid multiple anchors
+            var anchorSig = "#" + v.end[0] + "_" + v.end[1];
+            if (v.end[0] > v.end[1]) {
+              anchorSig = "#" + v.end[1] + "_" + v.end[0];
             };
-            anchors[anchorSig] = anchor;
-            // anchors.push(v.startAnchor);
+
+            // Check if the anchor already exist
+            var anchor = anchors[anchorSig];
+            if (anchor === undefined) {
+              anchor = {
+                "first":   v.end[0],
+                "last" :   v.end[1],
+                "length" : v.end[1] - v.end[0]
+              };
+              anchors[anchorSig] = anchor;
+              // anchors.push(v.startAnchor);
+            };
+            
+            v.endAnchor = anchor;
+
+            // Add to anchors list
+            // anchors.push(v.endAnchor);
+            v.end = middle;
           };
-
-          v.endAnchor = anchor;
-
-          // Add to anchors list
-          // anchors.push(v.endAnchor);
-          v.end = middle;
         };
 
         v.first = v.start;
