Index: /apps/outlook/branches/1.5/DotTelSystem/DNS/Records/DNSUnlinkedTelnameNaptrResourceRecord.cs
===================================================================
--- /apps/outlook/branches/1.5/DotTelSystem/DNS/Records/DNSUnlinkedTelnameNaptrResourceRecord.cs (revision 580)
+++ /apps/outlook/branches/1.5/DotTelSystem/DNS/Records/DNSUnlinkedTelnameNaptrResourceRecord.cs (revision 588)
@@ -84,30 +84,52 @@
             this.serviceType = naptr.ServiceType;
             this.catagories = naptr.Catagories;
+            Logger.Log(Logger.Section.Lookups,"URI Path: " + naptr.UriPath);
             this.uriPath = naptr.UriPath;
+            Logger.Log(Logger.Section.Lookups, "URI Scheme: " + naptr.UriScheme);
             this.uriScheme = naptr.UriScheme;
             this.labels = naptr.Labels;
-            if (this.uriPath.StartsWith(";base64"))
+            string[] split = this.uriPath.Split(new char[] { ',' }, 2);
+            string stuff = split[0];
+            string txtStr = "";
+            if (split.Length > 1)
+            {
+                txtStr = split[1];
+            }
+            else
+            {
+                txtStr = split[0];
+            }
+            if (stuff == "" || split.Length <= 1 || this.uriScheme != "data:")
+            {
+                this.text = System.Uri.UnescapeDataString(txtStr);
+                this.display = true;
+            }
+            else if (stuff.StartsWith(";base64"))
             {
                 System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
                 System.Text.Decoder utf8Decode = encoder.GetDecoder();
 
-                byte[] todecode_byte = Convert.FromBase64String(this.uriPath.Substring(8, this.uriPath.Length-8));
-                int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
-                char[] decoded_char = new char[charCount];
-                utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
-                this.text = new string(decoded_char);
-
+                Logger.Log(Logger.Section.Lookups, "Base 64 String to decode: " + txtStr);
+                try
+                {
+                    byte[] todecode_byte = Convert.FromBase64String(txtStr);
+                    int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
+                    char[] decoded_char = new char[charCount];
+                    utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
+                    this.text = new string(decoded_char);
+                    if (UriHandler.getInstance().Displayable(this.serviceType, this.uriScheme) || !UriHandler.getInstance().KnownService(this.serviceType))
+                        this.display = true;
+                    else
+                        this.display = false;
+                }
+                catch (FormatException e)
+                {
+                    this.text = txtStr;
+                }
             }
             else
             {
-                if (this.uriScheme.StartsWith("data:"))
-                    this.text = this.uriPath.Substring(1, this.uriPath.Length - 1);
-                else
-                    this.text = this.uriPath;
+                this.display = false;
             }
-            if (UriHandler.getInstance().Displayable(this.serviceType, this.uriScheme) || !UriHandler.getInstance().KnownService(this.serviceType))
-                this.display = true;
-            else
-                this.display = false;
 
         }
Index: /apps/outlook/branches/1.5/DotTelSystem/DNS/DNSInputStream.cs
===================================================================
--- /apps/outlook/branches/1.5/DotTelSystem/DNS/DNSInputStream.cs (revision 577)
+++ /apps/outlook/branches/1.5/DotTelSystem/DNS/DNSInputStream.cs (revision 588)
@@ -463,4 +463,12 @@
                 return null;
             }
+              try
+            {
+                while (this.Position < end)
+                {
+                    txtStr = txtStr + this.ReadString();
+                }
+            }
+            catch (EndOfStreamException) { }
             return new DNSTxtResourceRecord(ttl, txtStr);
 		}
@@ -521,5 +529,14 @@
         private DNSNInfoResourceRecord ReadNInfo(long rrTTL, int rrDataLen)
         {
-            string txtStr = ReadString();
+            long end = this.Position + rrDataLen;
+            string txtStr = "";
+            try
+            {
+                while (this.Position < end)
+                {
+                    txtStr = txtStr + this.ReadString();
+                }
+            }
+            catch (EndOfStreamException) { }
             if (txtStr.Trim() == DNSStructuredKeywordsTxtResourceRecord.TXTTYPE
                             || txtStr.Trim() == DNSTxtServiceMessageResourceRecord.TXTTYPE)
Index: /apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/LookupCache.cs
===================================================================
--- /apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/LookupCache.cs (revision 577)
+++ /apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/LookupCache.cs (revision 588)
@@ -121,8 +121,9 @@
             lock (cache)
             {
-               string  privateTelname = Publishers.Instance.GetPrivateTelname(telname);
-               if (cache.ContainsKey(privateTelname))
-                {
-                    return cache[privateTelname];
+                //Commented out because it is unnecessary
+                //string  privateTelname = Publishers.Instance.GetPrivateTelname(telname);
+               if (cache.ContainsKey(telname))
+                {
+                    return cache[telname];
                 }
             }
Index: /apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/CacheUpdater.cs
===================================================================
--- /apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/CacheUpdater.cs (revision 577)
+++ /apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/CacheUpdater.cs (revision 588)
@@ -128,5 +128,4 @@
                 try
                 {
-                    
                     string privateTelname = Publishers.Instance.GetPrivateTelname(telname);
 
Index: /apps/outlook/branches/1.5/DotTelSystem/Lookup/LookupResult.cs
===================================================================
--- /apps/outlook/branches/1.5/DotTelSystem/Lookup/LookupResult.cs (revision 577)
+++ /apps/outlook/branches/1.5/DotTelSystem/Lookup/LookupResult.cs (revision 588)
@@ -148,6 +148,4 @@
             }
         }
-        /// <summary> The keyword records.</summary>
-        private System.Collections.ArrayList newKeywordRecords;
 
         /// <summary> The keyword records.</summary>
@@ -1088,5 +1086,5 @@
 
                         XmlElement uriElement = doc.CreateElement("Uri");
-                        uriElement.InnerText = rr.ReplaceStr.Replace("\\", "\\\\");
+                        uriElement.InnerText = Uri.UnescapeDataString(rr.Uri).Replace("\\", "\\\\");
                         naptrRecord.AppendChild(uriElement);
 
Index: /apps/outlook/branches/1.5/DotTelSystem/Lookup/Lookup.cs
===================================================================
--- /apps/outlook/branches/1.5/DotTelSystem/Lookup/Lookup.cs (revision 577)
+++ /apps/outlook/branches/1.5/DotTelSystem/Lookup/Lookup.cs (revision 588)
@@ -169,5 +169,4 @@
             }
             completeListener = lc;
-
             string privateTelname = Publishers.Instance.GetPrivateTelname(telname);
             this.PerformLookup(privateTelname, telname);
