diff --git a/src/security/certstore.cpp b/src/security/certstore.cpp
index 39abe73db10f0ca2708d40efd22e65817406de32..17e7eb3e80ff71119cfa34937033f0a9d67c2868 100644
--- a/src/security/certstore.cpp
+++ b/src/security/certstore.cpp
@@ -68,11 +68,11 @@ CertificateStore::loadLocalCertificates()
         try {
             auto crt = std::make_shared<crypto::Certificate>(
                 fileutils::loadFile(certPath_ + DIR_SEPARATOR_CH + f));
-            auto id = crt->getId().toString();
-            auto longId = crt->getLongId().toString();
-            if (id != f && longId != f)
-                throw std::logic_error("Certificate id mismatch");
             while (crt) {
+                auto id = crt->getId().toString();
+                auto longId = crt->getLongId().toString();
+                if (id != f && longId != f)
+                    throw std::logic_error("Certificate id mismatch");
                 certs_.emplace(std::move(id), crt);
                 certs_.emplace(std::move(longId), crt);
                 loadRevocations(*crt);
@@ -80,6 +80,7 @@ CertificateStore::loadLocalCertificates()
                 ++n;
             }
         } catch (const std::exception& e) {
+            JAMI_WARN() << "Remove cert. " << e.what();
             remove((certPath_ + DIR_SEPARATOR_CH + f).c_str());
         }
     }
@@ -396,7 +397,8 @@ void
 CertificateStore::pinRevocationList(const std::string& id, const dht::crypto::RevocationList& crl)
 {
     fileutils::check_dir((crlPath_ + DIR_SEPARATOR_CH + id).c_str());
-    fileutils::saveFile(crlPath_ + DIR_SEPARATOR_CH + id + DIR_SEPARATOR_CH + dht::toHex(crl.getNumber()),
+    fileutils::saveFile(crlPath_ + DIR_SEPARATOR_CH + id + DIR_SEPARATOR_CH
+                            + dht::toHex(crl.getNumber()),
                         crl.getPacked());
 }