diff --git a/lib/SimpleSAML/IdP.php b/lib/SimpleSAML/IdP.php
index 9eecac8ddf9660e619205e3e361552fe24f91754..d9c895ad8acf9d0cc793e28086225e8d6ba13377 100644
--- a/lib/SimpleSAML/IdP.php
+++ b/lib/SimpleSAML/IdP.php
@@ -70,6 +70,7 @@ class IdP
         assert(is_string($id));
 
         $this->id = $id;
+        $this->associationGroup = $id;
 
         $metadata = MetaDataStorageHandler::getMetadataHandler();
         $globalConfig = Configuration::getInstance();
@@ -101,10 +102,6 @@ class IdP
             throw new \Exception("Protocol not implemented.");
         }
 
-        if ($this->associationGroup === null) {
-            $this->associationGroup = $this->id;
-        }
-
         $auth = $this->config->getString('auth');
         if (Auth\Source::getById($auth) !== null) {
             $this->authSource = new Auth\Simple($auth);
diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php
index 35f862981a3351d9dd6ff3df16d67687189ca368..35bd85e48764e488f631d32140fe3fe0b1d91213 100644
--- a/lib/SimpleSAML/Memcache.php
+++ b/lib/SimpleSAML/Memcache.php
@@ -322,7 +322,9 @@ class Memcache
             throw new \Exception(
                 'Missing Memcached implementation. You must install either the Memcache or Memcached extension.'
             );
-        } elseif (strtolower($class) === '\memcache') {
+        }
+
+        if (self::$extension === '\memcache') {
             Logger::warning("The use of PHP-extension memcache is deprecated. Please migrate to the memcached extension.");
         }
 
diff --git a/lib/SimpleSAML/SessionHandlerPHP.php b/lib/SimpleSAML/SessionHandlerPHP.php
index a1bff138d0f431057abc193051651621f3208bc8..c1762da701ea5443b3a71c369625f513eeb25e97 100644
--- a/lib/SimpleSAML/SessionHandlerPHP.php
+++ b/lib/SimpleSAML/SessionHandlerPHP.php
@@ -77,6 +77,7 @@ class SessionHandlerPHP extends SessionHandler
 
         if (!headers_sent()) {
             if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
+                /** @psalm-suppress InvalidArgument  This annotation may be removed in Psalm >=3.0.15 */
                 session_set_cookie_params([
                     'lifetime' => $params['lifetime'],
                     'path' => $params['path'],
@@ -357,6 +358,7 @@ class SessionHandlerPHP extends SessionHandler
         }
 
         if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
+            /** @psalm-suppress InvalidArgument  This annotation may be removed in Psalm >=3.0.15 */
             session_set_cookie_params($cookieParams);
         } else {
             session_set_cookie_params(