diff --git a/metadata-templates/saml20-sp-remote.php b/metadata-templates/saml20-sp-remote.php
index 2cf2873ca283ee7bee8b186c841499925d156b5f..7ed135bbfe453dff88eb83cdfeef20320f50168f 100644
--- a/metadata-templates/saml20-sp-remote.php
+++ b/metadata-templates/saml20-sp-remote.php
@@ -10,8 +10,8 @@
  * Example SimpleSAMLphp SAML 2.0 SP
  */
 $metadata['https://saml2sp.example.org'] = [
-    'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
-    'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/singleLogoutService/default-sp',
+    'AssertionConsumerService' => 'https://saml2.example.org/module.php/saml/sp/assertionConsumerService/default-sp',
+    'SingleLogoutService' => 'https://saml2sp.example.org/module.php/saml/sp/singleLogoutService/default-sp',
 ];
 
 /*
diff --git a/modules/saml/lib/Controller/ServiceProvider.php b/modules/saml/lib/Controller/ServiceProvider.php
index bf48408aee4d09ebb06a7dbe6bc3c28e3df0551f..21c193a46ad8fb83ae61d5015cdfdb05729389be 100644
--- a/modules/saml/lib/Controller/ServiceProvider.php
+++ b/modules/saml/lib/Controller/ServiceProvider.php
@@ -207,9 +207,11 @@ class ServiceProvider
              * In that case we may as well just redo the previous redirect
              * instead of displaying a confusing error message.
              */
-            Logger::info(
-                'Duplicate SAML 2 response detected - ignoring the response and redirecting the user to the correct page.'
-            );
+            Logger::info(sprintf(
+                '%s - %s',
+                'Duplicate SAML 2 response detected',
+                'ignoring the response and redirecting the user to the correct page.'
+            ));
             if (isset($prevAuth['redirect'])) {
                 return new RunnableResponse([$httpUtils, 'redirectTrustedURL'], [$prevAuth['redirect']]);
             }
@@ -245,7 +247,7 @@ class ServiceProvider
             Assert::keyExists($state, 'saml:sp:AuthId');
             if ($state['saml:sp:AuthId'] !== $sourceId) {
                 throw new Error\Exception(
-                    'The authentication source id in the URL does not match the authentication source which sent the request.'
+                    "The authentication source id in the URL doesn't match the authentication source that sent the request."
                 );
             }
 
diff --git a/src/SimpleSAML/Error/ErrorCodes.php b/src/SimpleSAML/Error/ErrorCodes.php
index d08744bf715ebdd3adb653fadf6825065e206c33..e6866ec8ba85879f60e5c3fe5d8e5ab4fa836045 100644
--- a/src/SimpleSAML/Error/ErrorCodes.php
+++ b/src/SimpleSAML/Error/ErrorCodes.php
@@ -87,7 +87,8 @@ class ErrorCodes
                 "You accessed the Artifact Resolution Service interface, but did not " .
                 "provide a SAML ArtifactResolve message. Please note that this endpoint is" .
                 " not intended to be accessed directly."),
-            'AUTHSOURCEERROR' => Translate::noop('Authentication error in source %AUTHSOURCE%. The reason was: %REASON%'),
+            'AUTHSOURCEERROR' => Translate::noop("" .
+                'Authentication error in source %AUTHSOURCE%. The reason was: %REASON%'),
             'BADREQUEST' => Translate::noop('There is an error in the request to this page. The reason was: %REASON%'),
             'CASERROR' => Translate::noop('Error when communicating with the CAS server.'),
             'CONFIG' => Translate::noop('SimpleSAMLphp appears to be misconfigured.'),
@@ -126,12 +127,13 @@ class ErrorCodes
                 "This endpoint is not enabled. Check the enable options in your " .
                 "configuration of SimpleSAMLphp."),
             'NOCERT' => Translate::noop('Authentication failed: your browser did not send any certificate'),
-            'NORELAYSTATE' => Translate::noop("".
+            'NORELAYSTATE' => Translate::noop("" .
                 "The initiator of this request did not provide a RelayState parameter " .
                 "indicating where to go next."),
             'NOSTATE' => Translate::noop('State information lost, and no way to restart the request'),
             'NOTFOUND' => Translate::noop('The given page was not found. The URL was: %URL%'),
-            'NOTFOUNDREASON' => Translate::noop("The given page was not found. The reason was: %REASON%  The URL was: %URL%"),
+            'NOTFOUNDREASON' => Translate::noop("" .
+                "The given page was not found. The reason was: %REASON%  The URL was: %URL%"),
             'NOTSET' => Translate::noop("" .
                 "The password in the configuration (auth.adminpassword) is not changed " .
                 "from the default value. Please edit the configuration file."),
diff --git a/tests/lib/SimpleSAML/Auth/SimpleTest.php b/tests/src/SimpleSAML/Auth/SimpleTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Auth/SimpleTest.php
rename to tests/src/SimpleSAML/Auth/SimpleTest.php
diff --git a/tests/lib/SimpleSAML/Auth/SourceTest.php b/tests/src/SimpleSAML/Auth/SourceTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Auth/SourceTest.php
rename to tests/src/SimpleSAML/Auth/SourceTest.php
diff --git a/tests/lib/SimpleSAML/Auth/StateTest.php b/tests/src/SimpleSAML/Auth/StateTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Auth/StateTest.php
rename to tests/src/SimpleSAML/Auth/StateTest.php
diff --git a/tests/lib/SimpleSAML/ConfigurationTest.php b/tests/src/SimpleSAML/ConfigurationTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/ConfigurationTest.php
rename to tests/src/SimpleSAML/ConfigurationTest.php
diff --git a/tests/lib/SimpleSAML/DatabaseTest.php b/tests/src/SimpleSAML/DatabaseTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/DatabaseTest.php
rename to tests/src/SimpleSAML/DatabaseTest.php
diff --git a/tests/lib/SimpleSAML/Locale/LanguageTest.php b/tests/src/SimpleSAML/Locale/LanguageTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Locale/LanguageTest.php
rename to tests/src/SimpleSAML/Locale/LanguageTest.php
diff --git a/tests/lib/SimpleSAML/Locale/LocalizationTest.php b/tests/src/SimpleSAML/Locale/LocalizationTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Locale/LocalizationTest.php
rename to tests/src/SimpleSAML/Locale/LocalizationTest.php
diff --git a/tests/lib/SimpleSAML/Locale/TranslateTest.php b/tests/src/SimpleSAML/Locale/TranslateTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Locale/TranslateTest.php
rename to tests/src/SimpleSAML/Locale/TranslateTest.php
diff --git a/tests/lib/SimpleSAML/LoggerTest.php b/tests/src/SimpleSAML/LoggerTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/LoggerTest.php
rename to tests/src/SimpleSAML/LoggerTest.php
diff --git a/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php b/tests/src/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
rename to tests/src/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
diff --git a/tests/lib/SimpleSAML/Metadata/MetaDataStorageSourceTest.php b/tests/src/SimpleSAML/Metadata/MetaDataStorageSourceTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/MetaDataStorageSourceTest.php
rename to tests/src/SimpleSAML/Metadata/MetaDataStorageSourceTest.php
diff --git a/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php b/tests/src/SimpleSAML/Metadata/SAMLBuilderTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
rename to tests/src/SimpleSAML/Metadata/SAMLBuilderTest.php
diff --git a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php b/tests/src/SimpleSAML/Metadata/SAMLParserTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
rename to tests/src/SimpleSAML/Metadata/SAMLParserTest.php
diff --git a/tests/lib/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php b/tests/src/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php
rename to tests/src/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php
diff --git a/tests/lib/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityB.serialized b/tests/src/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityB.serialized
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityB.serialized
rename to tests/src/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityB.serialized
diff --git a/tests/lib/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityInBoth.serialized b/tests/src/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityInBoth.serialized
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityInBoth.serialized
rename to tests/src/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/entityInBoth.serialized
diff --git a/tests/lib/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/expiredInSrc1InSrc2.serialized b/tests/src/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/expiredInSrc1InSrc2.serialized
similarity index 100%
rename from tests/lib/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/expiredInSrc1InSrc2.serialized
rename to tests/src/SimpleSAML/Metadata/test-metadata/source2/saml20-sp-remote/expiredInSrc1InSrc2.serialized
diff --git a/tests/lib/SimpleSAML/ModuleTest.php b/tests/src/SimpleSAML/ModuleTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/ModuleTest.php
rename to tests/src/SimpleSAML/ModuleTest.php
diff --git a/tests/lib/SimpleSAML/SessionHandlerPHPTest.php b/tests/src/SimpleSAML/SessionHandlerPHPTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/SessionHandlerPHPTest.php
rename to tests/src/SimpleSAML/SessionHandlerPHPTest.php
diff --git a/tests/lib/SimpleSAML/SessionTest.php b/tests/src/SimpleSAML/SessionTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/SessionTest.php
rename to tests/src/SimpleSAML/SessionTest.php
diff --git a/tests/lib/SimpleSAML/Store/RedisStoreTest.php b/tests/src/SimpleSAML/Store/RedisStoreTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Store/RedisStoreTest.php
rename to tests/src/SimpleSAML/Store/RedisStoreTest.php
diff --git a/tests/lib/SimpleSAML/Store/SQLStoreTest.php b/tests/src/SimpleSAML/Store/SQLStoreTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Store/SQLStoreTest.php
rename to tests/src/SimpleSAML/Store/SQLStoreTest.php
diff --git a/tests/lib/SimpleSAML/Store/StoreFactoryTest.php b/tests/src/SimpleSAML/Store/StoreFactoryTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Store/StoreFactoryTest.php
rename to tests/src/SimpleSAML/Store/StoreFactoryTest.php
diff --git a/tests/lib/SimpleSAML/Utils/ArraysTest.php b/tests/src/SimpleSAML/Utils/ArraysTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/ArraysTest.php
rename to tests/src/SimpleSAML/Utils/ArraysTest.php
diff --git a/tests/lib/SimpleSAML/Utils/AttributesTest.php b/tests/src/SimpleSAML/Utils/AttributesTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/AttributesTest.php
rename to tests/src/SimpleSAML/Utils/AttributesTest.php
diff --git a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php b/tests/src/SimpleSAML/Utils/Config/MetadataTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
rename to tests/src/SimpleSAML/Utils/Config/MetadataTest.php
diff --git a/tests/lib/SimpleSAML/Utils/ConfigTest.php b/tests/src/SimpleSAML/Utils/ConfigTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/ConfigTest.php
rename to tests/src/SimpleSAML/Utils/ConfigTest.php
diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/src/SimpleSAML/Utils/CryptoTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/CryptoTest.php
rename to tests/src/SimpleSAML/Utils/CryptoTest.php
diff --git a/tests/lib/SimpleSAML/Utils/EMailTest.php b/tests/src/SimpleSAML/Utils/EMailTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/EMailTest.php
rename to tests/src/SimpleSAML/Utils/EMailTest.php
diff --git a/tests/lib/SimpleSAML/Utils/HTTPTest.php b/tests/src/SimpleSAML/Utils/HTTPTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/HTTPTest.php
rename to tests/src/SimpleSAML/Utils/HTTPTest.php
diff --git a/tests/lib/SimpleSAML/Utils/NetTest.php b/tests/src/SimpleSAML/Utils/NetTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/NetTest.php
rename to tests/src/SimpleSAML/Utils/NetTest.php
diff --git a/tests/lib/SimpleSAML/Utils/RandomTest.php b/tests/src/SimpleSAML/Utils/RandomTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/RandomTest.php
rename to tests/src/SimpleSAML/Utils/RandomTest.php
diff --git a/tests/lib/SimpleSAML/Utils/SystemTest.php b/tests/src/SimpleSAML/Utils/SystemTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/SystemTest.php
rename to tests/src/SimpleSAML/Utils/SystemTest.php
diff --git a/tests/lib/SimpleSAML/Utils/TimeTest.php b/tests/src/SimpleSAML/Utils/TimeTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/TimeTest.php
rename to tests/src/SimpleSAML/Utils/TimeTest.php
diff --git a/tests/lib/SimpleSAML/Utils/TranslateTest.php b/tests/src/SimpleSAML/Utils/TranslateTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/TranslateTest.php
rename to tests/src/SimpleSAML/Utils/TranslateTest.php
diff --git a/tests/lib/SimpleSAML/Utils/XMLTest.php b/tests/src/SimpleSAML/Utils/XMLTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/Utils/XMLTest.php
rename to tests/src/SimpleSAML/Utils/XMLTest.php
diff --git a/tests/lib/SimpleSAML/XHTML/TemplateTest.php b/tests/src/SimpleSAML/XHTML/TemplateTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/XHTML/TemplateTest.php
rename to tests/src/SimpleSAML/XHTML/TemplateTest.php
diff --git a/tests/lib/SimpleSAML/XHTML/TemplateTranslationTest.php b/tests/src/SimpleSAML/XHTML/TemplateTranslationTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/XHTML/TemplateTranslationTest.php
rename to tests/src/SimpleSAML/XHTML/TemplateTranslationTest.php
diff --git a/tests/lib/SimpleSAML/XML/ErrorsTest.php b/tests/src/SimpleSAML/XML/ErrorsTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/XML/ErrorsTest.php
rename to tests/src/SimpleSAML/XML/ErrorsTest.php
diff --git a/tests/lib/SimpleSAML/XML/ParserTest.php b/tests/src/SimpleSAML/XML/ParserTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/XML/ParserTest.php
rename to tests/src/SimpleSAML/XML/ParserTest.php
diff --git a/tests/lib/SimpleSAML/XML/SignerTest.php b/tests/src/SimpleSAML/XML/SignerTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/XML/SignerTest.php
rename to tests/src/SimpleSAML/XML/SignerTest.php
diff --git a/tests/lib/SimpleSAML/XML/ValidatorTest.php b/tests/src/SimpleSAML/XML/ValidatorTest.php
similarity index 100%
rename from tests/lib/SimpleSAML/XML/ValidatorTest.php
rename to tests/src/SimpleSAML/XML/ValidatorTest.php