diff --git a/src/util/face-uri.cpp b/src/util/face-uri.cpp
index f38e8c2..c09da8a 100644
--- a/src/util/face-uri.cpp
+++ b/src/util/face-uri.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2015-2016, Regents of the University of California,
+ * Copyright (c) 2014-2016, Regents of the University of California,
  *                          Arizona Board of Regents,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University,
@@ -27,13 +27,14 @@
 
 #include "face-uri.hpp"
 #include "dns.hpp"
+#include "ethernet.hpp"
 
-#include <set>
 #include <boost/concept_check.hpp>
-#include <boost/regex.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/mpl/vector.hpp>
 #include <boost/mpl/for_each.hpp>
+#include <boost/regex.hpp>
+#include <set>
 
 namespace ndn {
 namespace util {
@@ -53,10 +54,8 @@
 }
 
 FaceUri::FaceUri(const char* uri)
+  : FaceUri(std::string(uri))
 {
-  if (!parse(uri)) {
-    BOOST_THROW_EXCEPTION(Error("Malformed URI: " + std::string(uri)));
-  }
 }
 
 bool
@@ -64,9 +63,9 @@
 {
   m_scheme.clear();
   m_host.clear();
-  m_isV6 = false;
   m_port.clear();
   m_path.clear();
+  m_isV6 = false;
 
   static const boost::regex protocolExp("(\\w+\\d?(\\+\\w+)?)://([^/]*)(\\/[^?]*)?");
   boost::smatch protocolMatch;
@@ -124,19 +123,19 @@
 }
 
 FaceUri::FaceUri(const boost::asio::ip::tcp::endpoint& endpoint, const std::string& scheme)
-  : m_scheme(scheme)
 {
   m_isV6 = endpoint.address().is_v6();
+  m_scheme = scheme;
   m_host = endpoint.address().to_string();
   m_port = to_string(endpoint.port());
 }
 
 #ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
 FaceUri::FaceUri(const boost::asio::local::stream_protocol::endpoint& endpoint)
-  : m_isV6(false)
+  : m_scheme("unix")
+  , m_path(endpoint.path())
+  , m_isV6(false)
 {
-  m_scheme = "unix";
-  m_path = endpoint.path();
 }
 #endif // BOOST_ASIO_HAS_LOCAL_SOCKETS
 
@@ -150,10 +149,10 @@
 }
 
 FaceUri::FaceUri(const ethernet::Address& address)
-  : m_isV6(true)
+  : m_scheme("ether")
+  , m_host(address.toString())
+  , m_isV6(true)
 {
-  m_scheme = "ether";
-  m_host = address.toString();
 }
 
 FaceUri
@@ -178,11 +177,11 @@
 bool
 FaceUri::operator==(const FaceUri& rhs) const
 {
-  return (m_scheme == rhs.m_scheme &&
-          m_host == rhs.m_host &&
-          m_isV6 == rhs.m_isV6 &&
-          m_port == rhs.m_port &&
-          m_path == rhs.m_path);
+  return m_isV6 == rhs.m_isV6 &&
+         m_scheme == rhs.m_scheme &&
+         m_host == rhs.m_host &&
+         m_port == rhs.m_port &&
+         m_path == rhs.m_path;
 }
 
 bool
@@ -216,6 +215,7 @@
   return os;
 }
 
+
 /** \brief a CanonizeProvider provides FaceUri canonization functionality for a group of schemes
  */
 class CanonizeProvider : noncopyable
@@ -244,11 +244,7 @@
   std::set<std::string>
   getSchemes() const override
   {
-    std::set<std::string> schemes;
-    schemes.insert(m_baseScheme);
-    schemes.insert(m_v4Scheme);
-    schemes.insert(m_v6Scheme);
-    return schemes;
+    return {m_baseScheme, m_v4Scheme, m_v6Scheme};
   }
 
   bool
@@ -272,8 +268,8 @@
     else {
       return false;
     }
-    return !static_cast<bool>(ec) && addr.to_string() == faceUri.getHost() &&
-           this->checkAddress(addr).first;
+
+    return !ec && addr.to_string() == faceUri.getHost() && checkAddress(addr).first;
   }
 
   void
@@ -300,7 +296,7 @@
     }
 
     // make a copy because caller may modify faceUri
-    shared_ptr<FaceUri> uri = make_shared<FaceUri>(faceUri);
+    auto uri = make_shared<FaceUri>(faceUri);
     dns::asyncResolve(faceUri.getHost(),
       bind(&IpHostCanonizeProvider<Protocol>::onDnsSuccess, this, uri, onSuccess, onFailure, _1),
       bind(&IpHostCanonizeProvider<Protocol>::onDnsFailure, this, uri, onFailure, _1),
@@ -313,25 +309,25 @@
                          uint16_t defaultUnicastPort = 6363,
                          uint16_t defaultMulticastPort = 56363)
     : m_baseScheme(baseScheme)
-    , m_v4Scheme(baseScheme + "4")
-    , m_v6Scheme(baseScheme + "6")
+    , m_v4Scheme(baseScheme + '4')
+    , m_v6Scheme(baseScheme + '6')
     , m_defaultUnicastPort(defaultUnicastPort)
     , m_defaultMulticastPort(defaultMulticastPort)
   {
   }
 
 private:
-  // faceUri is a shared_ptr passed by value because this function can take ownership
   void
-  onDnsSuccess(shared_ptr<FaceUri> faceUri,
+  onDnsSuccess(const shared_ptr<FaceUri>& faceUri,
                const FaceUri::CanonizeSuccessCallback& onSuccess,
                const FaceUri::CanonizeFailureCallback& onFailure,
                const dns::IpAddress& ipAddress) const
   {
-    std::pair<bool, std::string> checkAddressRes = this->checkAddress(ipAddress);
-    if (!checkAddressRes.first) {
-      onFailure(checkAddressRes.second);
-      return;
+    bool isOk = false;
+    std::string reason;
+    std::tie(isOk, reason) = this->checkAddress(ipAddress);
+    if (!isOk) {
+      return onFailure(reason);
     }
 
     uint16_t port = 0;
@@ -343,8 +339,7 @@
         port = boost::lexical_cast<uint16_t>(faceUri->getPort());
       }
       catch (const boost::bad_lexical_cast&) {
-        onFailure("invalid port number");
-        return;
+        return onFailure("invalid port number '" + faceUri->getPort() + "'");
       }
     }
 
@@ -353,9 +348,9 @@
     onSuccess(canonicalUri);
   }
 
-  // faceUri is a shared_ptr passed by value because this function can take ownership
   void
-  onDnsFailure(shared_ptr<FaceUri> faceUri, const FaceUri::CanonizeFailureCallback& onFailure,
+  onDnsFailure(const shared_ptr<FaceUri>& faceUri,
+               const FaceUri::CanonizeFailureCallback& onFailure,
                const std::string& reason) const
   {
     onFailure(reason);
@@ -418,9 +413,7 @@
   std::set<std::string>
   getSchemes() const override
   {
-    std::set<std::string> schemes;
-    schemes.insert("ether");
-    return schemes;
+    return {"ether"};
   }
 
   bool
@@ -433,7 +426,7 @@
       return false;
     }
 
-    ethernet::Address addr = ethernet::Address::fromString(faceUri.getHost());
+    auto addr = ethernet::Address::fromString(faceUri.getHost());
     return addr.toString() == faceUri.getHost();
   }
 
@@ -443,10 +436,9 @@
            const FaceUri::CanonizeFailureCallback& onFailure,
            boost::asio::io_service& io, const time::nanoseconds& timeout) const override
   {
-    ethernet::Address addr = ethernet::Address::fromString(faceUri.getHost());
+    auto addr = ethernet::Address::fromString(faceUri.getHost());
     if (addr.isNull()) {
-      onFailure("cannot parse address");
-      return;
+      return onFailure("invalid ethernet address '" + faceUri.getHost() + "'");
     }
 
     FaceUri canonicalUri(addr);
@@ -491,13 +483,11 @@
   }
 };
 
-typedef boost::mpl::vector<
-    UdpCanonizeProvider*,
-    TcpCanonizeProvider*,
-    EtherCanonizeProvider*,
-    UdpDevCanonizeProvider*
-  > CanonizeProviders;
-typedef std::map<std::string, shared_ptr<CanonizeProvider> > CanonizeProviderTable;
+using CanonizeProviders = boost::mpl::vector<UdpCanonizeProvider*,
+                                             TcpCanonizeProvider*,
+                                             EtherCanonizeProvider*,
+                                             UdpDevCanonizeProvider*>;
+using CanonizeProviderTable = std::map<std::string, shared_ptr<CanonizeProvider>>;
 
 class CanonizeProviderTableInitializer
 {
@@ -508,17 +498,17 @@
   {
   }
 
-  template<typename CP> void
+  template<typename CP>
+  void
   operator()(CP*)
   {
     shared_ptr<CanonizeProvider> cp = make_shared<CP>();
-
-    std::set<std::string> schemes = cp->getSchemes();
+    auto schemes = cp->getSchemes();
     BOOST_ASSERT(!schemes.empty());
-    for (std::set<std::string>::iterator it = schemes.begin();
-         it != schemes.end(); ++it) {
-      BOOST_ASSERT(m_providerTable.count(*it) == 0);
-      m_providerTable[*it] = cp;
+
+    for (const auto& scheme : schemes) {
+      BOOST_ASSERT(m_providerTable.count(scheme) == 0);
+      m_providerTable[scheme] = cp;
     }
   }
 
@@ -536,23 +526,21 @@
   }
 
   auto it = providerTable.find(scheme);
-  if (it == providerTable.end()) {
-    return nullptr;
-  }
-  return it->second.get();
+  return it == providerTable.end() ? nullptr : it->second.get();
 }
 
+
 bool
 FaceUri::canCanonize(const std::string& scheme)
 {
-  return getCanonizeProvider(scheme) != 0;
+  return getCanonizeProvider(scheme) != nullptr;
 }
 
 bool
 FaceUri::isCanonical() const
 {
   const CanonizeProvider* cp = getCanonizeProvider(this->getScheme());
-  if (cp == 0) {
+  if (cp == nullptr) {
     return false;
   }
 
@@ -574,7 +562,6 @@
 
   static CanonizeSuccessCallback successNop = bind([]{});
   static CanonizeFailureCallback failureNop = bind([]{});
-
   cp->canonize(*this,
                onSuccess ? onSuccess : successNop,
                onFailure ? onFailure : failureNop,
diff --git a/src/util/face-uri.hpp b/src/util/face-uri.hpp
index b222323..f726388 100644
--- a/src/util/face-uri.hpp
+++ b/src/util/face-uri.hpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
+ * Copyright (c) 2014-2016, Regents of the University of California,
+ *                          Arizona Board of Regents,
+ *                          Colorado State University,
+ *                          University Pierre & Marie Curie, Sorbonne University,
+ *                          Washington University in St. Louis,
+ *                          Beijing Institute of Technology,
+ *                          The University of Memphis.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -29,15 +29,19 @@
 #define NDN_UTIL_FACE_URI_HPP
 
 #include "../common.hpp"
-#include <boost/asio/ip/udp.hpp>
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/local/stream_protocol.hpp>
-#include "ethernet.hpp"
 #include "time.hpp"
 
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/ip/udp.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
+
 namespace ndn {
 namespace util {
 
+namespace ethernet {
+class Address;
+} // namespace ethernet
+
 /** \brief represents the underlying protocol and address used by a Face
  *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#FaceUri
  */
@@ -82,7 +86,7 @@
   explicit
   FaceUri(const boost::asio::ip::tcp::endpoint& endpoint);
 
-  /// construct tcp canonical FaceUri with customized scheme
+  /// construct tcp canonical FaceUri with custom scheme
   FaceUri(const boost::asio::ip::tcp::endpoint& endpoint, const std::string& scheme);
 
 #ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
@@ -176,15 +180,16 @@
   void
   canonize(const CanonizeSuccessCallback& onSuccess,
            const CanonizeFailureCallback& onFailure,
-           boost::asio::io_service& io, const time::nanoseconds& timeout) const;
+           boost::asio::io_service& io,
+           const time::nanoseconds& timeout) const;
 
 private:
   std::string m_scheme;
   std::string m_host;
-  /// whether to add [] around host when writing string
-  bool m_isV6;
   std::string m_port;
   std::string m_path;
+  /// whether to add [] around host when writing string
+  bool m_isV6;
 
   friend std::ostream& operator<<(std::ostream& os, const FaceUri& uri);
 };
diff --git a/tests/unit-tests/util/face-uri.t.cpp b/tests/unit-tests/util/face-uri.t.cpp
index b63c2de..74c6784 100644
--- a/tests/unit-tests/util/face-uri.t.cpp
+++ b/tests/unit-tests/util/face-uri.t.cpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016 Regents of the University of California,
- *                         Arizona Board of Regents,
- *                         Colorado State University,
- *                         University Pierre & Marie Curie, Sorbonne University,
- *                         Washington University in St. Louis,
- *                         Beijing Institute of Technology,
- *                         The University of Memphis.
+ * Copyright (c) 2014-2016, Regents of the University of California,
+ *                          Arizona Board of Regents,
+ *                          Colorado State University,
+ *                          University Pierre & Marie Curie, Sorbonne University,
+ *                          Washington University in St. Louis,
+ *                          Beijing Institute of Technology,
+ *                          The University of Memphis.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -26,6 +26,7 @@
  */
 
 #include "util/face-uri.hpp"
+#include "util/ethernet.hpp"
 
 #include "boost-test.hpp"
 #include "../network-configuration-detector.hpp"
@@ -42,13 +43,17 @@
 class CanonizeFixture : noncopyable
 {
 protected:
-  CanonizeFixture()
-    : m_nPending(0)
-  {
-  }
-
   void
-  addTest(const std::string& request, bool shouldSucceed, const std::string& expectedUri);
+  addTest(const std::string& request, bool shouldSucceed, const std::string& expectedUri)
+  {
+    ++m_nPending;
+    auto tc = make_shared<CanonizeTestCase>(request, shouldSucceed, expectedUri);
+
+    FaceUri uri(request);
+    uri.canonize(bind(&CanonizeFixture::onCanonizeSuccess, this, tc, _1),
+                 bind(&CanonizeFixture::onCanonizeFailure, this, tc, _1),
+                 m_io, time::seconds(10));
+  }
 
   void
   runTests()
@@ -61,39 +66,38 @@
   class CanonizeTestCase
   {
   public:
-    CanonizeTestCase(const std::string& request,
-                     bool shouldSucceed, const std::string& expectedUri)
-      : m_shouldSucceed(shouldSucceed)
-      , m_expectedUri(expectedUri)
+    CanonizeTestCase(const std::string& request, bool shouldSucceed, const std::string& expectedUri)
+      : m_expectedUri(expectedUri)
       , m_message(request + " should " + (shouldSucceed ? "succeed" : "fail"))
+      , m_shouldSucceed(shouldSucceed)
       , m_isCompleted(false)
     {
     }
 
   public:
-    bool m_shouldSucceed;
     std::string m_expectedUri;
     std::string m_message;
+    bool m_shouldSucceed;
     bool m_isCompleted;
   };
 
-  // tc is a shared_ptr passed by value, because this function can take ownership
   void
-  onCanonizeSuccess(shared_ptr<CanonizeTestCase> tc, const FaceUri& canonicalUri)
+  onCanonizeSuccess(const shared_ptr<CanonizeTestCase>& tc, const FaceUri& canonicalUri)
   {
-    BOOST_CHECK(!tc->m_isCompleted);
+    BOOST_CHECK_EQUAL(tc->m_isCompleted, false);
     tc->m_isCompleted = true;
     --m_nPending;
 
     BOOST_CHECK_MESSAGE(tc->m_shouldSucceed, tc->m_message);
-    BOOST_CHECK_EQUAL(tc->m_expectedUri, canonicalUri.toString());
+    if (tc->m_shouldSucceed) {
+      BOOST_CHECK_EQUAL(canonicalUri.toString(), tc->m_expectedUri);
+    }
   }
 
-  // tc is a shared_ptr passed by value, because this function can take ownership
   void
-  onCanonizeFailure(shared_ptr<CanonizeTestCase> tc, const std::string& reason)
+  onCanonizeFailure(const shared_ptr<CanonizeTestCase>& tc, const std::string& reason)
   {
-    BOOST_CHECK(!tc->m_isCompleted);
+    BOOST_CHECK_EQUAL(tc->m_isCompleted, false);
     tc->m_isCompleted = true;
     --m_nPending;
 
@@ -102,22 +106,9 @@
 
 private:
   boost::asio::io_service m_io;
-  ssize_t m_nPending;
+  ssize_t m_nPending = 0;
 };
 
-void
-CanonizeFixture::addTest(const std::string& request,
-                         bool shouldSucceed, const std::string& expectedUri)
-{
-  ++m_nPending;
-  auto tc = make_shared<CanonizeTestCase>(request, shouldSucceed, expectedUri);
-
-  FaceUri uri(request);
-  uri.canonize(bind(&CanonizeFixture::onCanonizeSuccess, this, tc, _1),
-               bind(&CanonizeFixture::onCanonizeFailure, this, tc, _1),
-               m_io, time::seconds(10));
-}
-
 BOOST_AUTO_TEST_CASE(ParseInternal)
 {
   FaceUri uri;
@@ -167,7 +158,8 @@
 
   BOOST_CHECK_EQUAL(uri.parse("udp6://[2001:db8:3f9:0:3025:ccc5:eeeb:86dg]:6363"), false);
 
-  using namespace boost::asio;
+  namespace ip = boost::asio::ip;
+
   ip::udp::endpoint endpoint4(ip::address_v4::from_string("192.0.2.1"), 7777);
   BOOST_REQUIRE_NO_THROW(FaceUri(endpoint4));
   BOOST_CHECK_EQUAL(FaceUri(endpoint4).toString(), "udp4://192.0.2.1:7777");
@@ -177,7 +169,7 @@
   BOOST_CHECK_EQUAL(FaceUri(endpoint6).toString(), "udp6://[2001:db8::1]:7777");
 }
 
-BOOST_FIXTURE_TEST_CASE(CheckCanonicalUdp, CanonizeFixture)
+BOOST_FIXTURE_TEST_CASE(IsCanonicalUdp, CanonizeFixture)
 {
   BOOST_CHECK_EQUAL(FaceUri::canCanonize("udp"), true);
   BOOST_CHECK_EQUAL(FaceUri::canCanonize("udp4"), true);
@@ -195,6 +187,7 @@
   BOOST_CHECK_EQUAL(FaceUri("udp4://224.0.23.170:56363").isCanonical(), true);
 }
 
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanonizeUdpV4, 1)
 BOOST_FIXTURE_TEST_CASE(CanonizeUdpV4, CanonizeFixture)
 {
   SKIP_IF_IPV4_UNAVAILABLE();
@@ -206,6 +199,7 @@
   addTest("udp4://192.0.2.4:6363/", true, "udp4://192.0.2.4:6363");
   addTest("udp4://192.0.2.5:9695", true, "udp4://192.0.2.5:9695");
   addTest("udp4://192.0.2.666:6363", false, "");
+  addTest("udp4://192.0.2.7:99999", false, ""); // Bug #3897
   addTest("udp4://google-public-dns-a.google.com", true, "udp4://8.8.8.8:6363");
   addTest("udp4://google-public-dns-a.google.com:70000", false, "");
   addTest("udp4://invalid.invalid", false, "");
@@ -218,6 +212,7 @@
   runTests();
 }
 
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanonizeUdpV6, 1)
 BOOST_FIXTURE_TEST_CASE(CanonizeUdpV6, CanonizeFixture)
 {
   SKIP_IF_IPV6_UNAVAILABLE();
@@ -228,6 +223,7 @@
   addTest("udp://[2001:db8::1]:6363", true, "udp6://[2001:db8::1]:6363");
   addTest("udp6://[2001:db8::01]:6363", true, "udp6://[2001:db8::1]:6363");
   addTest("udp6://[2001::db8::1]:6363", false, "");
+  addTest("udp6://[2001:db8::1]:99999", false, ""); // Bug #3897
   addTest("udp6://google-public-dns-a.google.com", true, "udp6://[2001:4860:4860::8888]:6363");
   addTest("udp6://google-public-dns-a.google.com:70000", false, "");
   addTest("udp6://invalid.invalid", false, "");
@@ -253,7 +249,8 @@
   BOOST_CHECK_EQUAL(uri.parse("tcp://192.0.2.1:"), false);
   BOOST_CHECK_EQUAL(uri.parse("tcp://[::zzzz]"), false);
 
-  using namespace boost::asio;
+  namespace ip = boost::asio::ip;
+
   ip::tcp::endpoint endpoint4(ip::address_v4::from_string("192.0.2.1"), 7777);
   BOOST_REQUIRE_NO_THROW(FaceUri(endpoint4));
   BOOST_CHECK_EQUAL(FaceUri(endpoint4).toString(), "tcp4://192.0.2.1:7777");
@@ -266,7 +263,7 @@
   BOOST_CHECK_EQUAL(FaceUri(endpoint6).toString(), "tcp6://[2001:db8::1]:7777");
 }
 
-BOOST_FIXTURE_TEST_CASE(CheckCanonicalTcp, CanonizeFixture)
+BOOST_FIXTURE_TEST_CASE(IsCanonicalTcp, CanonizeFixture)
 {
   BOOST_CHECK_EQUAL(FaceUri::canCanonize("tcp"), true);
   BOOST_CHECK_EQUAL(FaceUri::canCanonize("tcp4"), true);
@@ -284,6 +281,7 @@
   BOOST_CHECK_EQUAL(FaceUri("tcp4://224.0.23.170:56363").isCanonical(), false);
 }
 
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanonizeTcpV4, 1)
 BOOST_FIXTURE_TEST_CASE(CanonizeTcpV4, CanonizeFixture)
 {
   SKIP_IF_IPV4_UNAVAILABLE();
@@ -295,6 +293,7 @@
   addTest("tcp4://192.0.2.4:6363/", true, "tcp4://192.0.2.4:6363");
   addTest("tcp4://192.0.2.5:9695", true, "tcp4://192.0.2.5:9695");
   addTest("tcp4://192.0.2.666:6363", false, "");
+  addTest("tcp4://192.0.2.7:99999", false, ""); // Bug #3897
   addTest("tcp4://google-public-dns-a.google.com", true, "tcp4://8.8.8.8:6363");
   addTest("tcp4://google-public-dns-a.google.com:70000", false, "");
   addTest("tcp4://invalid.invalid", false, "");
@@ -307,6 +306,7 @@
   runTests();
 }
 
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanonizeTcpV6, 1)
 BOOST_FIXTURE_TEST_CASE(CanonizeTcpV6, CanonizeFixture)
 {
   SKIP_IF_IPV6_UNAVAILABLE();
@@ -317,6 +317,7 @@
   addTest("tcp://[2001:db8::1]:6363", true, "tcp6://[2001:db8::1]:6363");
   addTest("tcp6://[2001:db8::01]:6363", true, "tcp6://[2001:db8::1]:6363");
   addTest("tcp6://[2001::db8::1]:6363", false, "");
+  addTest("tcp6://[2001:db8::1]:99999", false, ""); // Bug #3897
   addTest("tcp6://google-public-dns-a.google.com", true, "tcp6://[2001:4860:4860::8888]:6363");
   addTest("tcp6://google-public-dns-a.google.com:70000", false, "");
   addTest("tcp6://invalid.invalid", false, "");
@@ -329,6 +330,7 @@
   runTests();
 }
 
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(ParseUnix, 1)
 BOOST_AUTO_TEST_CASE(ParseUnix)
 {
   FaceUri uri;
@@ -339,15 +341,15 @@
   BOOST_CHECK_EQUAL(uri.getPort(), "");
   BOOST_CHECK_EQUAL(uri.getPath(), "/var/run/example.sock");
 
-  //BOOST_CHECK_EQUAL(uri.parse("unix://var/run/example.sock"), false);
-  // This is not a valid unix:/ URI, but the parse would treat "var" as host
+  // This is not a valid unix:// URI, but the parse would treat "var" as host
+  BOOST_CHECK_EQUAL(uri.parse("unix://var/run/example.sock"), false); // Bug #3896
 
-#ifdef HAVE_UNIX_SOCKETS
-  using namespace boost::asio;
-  local::stream_protocol::endpoint endpoint("/var/run/example.sock");
+#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
+  using boost::asio::local::stream_protocol;
+  stream_protocol::endpoint endpoint("/var/run/example.sock");
   BOOST_REQUIRE_NO_THROW(FaceUri(endpoint));
   BOOST_CHECK_EQUAL(FaceUri(endpoint).toString(), "unix:///var/run/example.sock");
-#endif // HAVE_UNIX_SOCKETS
+#endif // BOOST_ASIO_HAS_LOCAL_SOCKETS
 }
 
 BOOST_AUTO_TEST_CASE(ParseFd)
@@ -377,7 +379,7 @@
 
   BOOST_CHECK_EQUAL(uri.parse("ether://[08:00:27:zz:dd:01]"), false);
 
-  ethernet::Address address = ethernet::Address::fromString("33:33:01:01:01:01");
+  auto address = ethernet::Address::fromString("33:33:01:01:01:01");
   BOOST_REQUIRE_NO_THROW(FaceUri(address));
   BOOST_CHECK_EQUAL(FaceUri(address).toString(), "ether://[33:33:01:01:01:01]");
 }
@@ -434,7 +436,7 @@
   BOOST_CHECK(!uri.parse("abc+://eth0"));
   BOOST_CHECK(!uri.parse("+abc://eth0"));
 
-  using namespace boost::asio;
+  namespace ip = boost::asio::ip;
 
   ip::udp::endpoint endpoint4(ip::udp::v4(), 7777);
   BOOST_REQUIRE_NO_THROW(FaceUri::fromUdpDev(endpoint4, "en1"));
