diff --git a/sites/all/modules/unl/unl_migration.php b/sites/all/modules/unl/unl_migration.php
index f4c76759a3236ed52b17c3e2bfea24eff5395187..6d0f062f329831f685b961dc05bffb57ed9ad419 100644
--- a/sites/all/modules/unl/unl_migration.php
+++ b/sites/all/modules/unl/unl_migration.php
@@ -209,6 +209,9 @@ class Unl_Migration_Tool
         		}
                 if ($fragmentPos = strrpos($path, '#') !== FALSE) {
                     $path = substr($path, 0, $fragmentPos);
+                }
+                if (substr($path, -1) == '/') {
+                	$path = substr($path, 0, -1);
                 }
         		$nodeId = array_search($path, $this->_nodeMap, TRUE);
         		$item['link_path'] = 'node/' . $nodeId;
@@ -239,9 +242,11 @@ class Unl_Migration_Tool
 	                    $path = '';
 	                }
 	                if (($fragmentPos = strrpos($path, '#')) !== FALSE) {
-	                	echo "strrpos() = $fragmentPos\n";
 	                	$path = substr($path, 0, $fragmentPos);
 	                }
+	                if (substr($path, -1) == '/') {
+	                    $path = substr($path, 0, -1);
+	                }
                     $nodeId = array_search($path, $this->_nodeMap, TRUE);
                     $item['link_path'] = 'node/' . $nodeId;
                     echo '[' . $nodeId . '] => ' . $path . PHP_EOL;