diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index ed7f9559cdb7a059f60a904b5c0f2b8a9db77abc..1cae3e4c4b6ba95ee98a43db755f253e9851f700 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -272,7 +272,7 @@ class SimpleSAML_Metadata_SAMLParser {
 
 		$doc = new DOMDocument();
 
-		$res = $doc->load($file);
+		$res = @$doc->load($file);
 		if($res !== TRUE) {
 			throw new Exception('Failed to read XML from file: ' . $file);
 		}
diff --git a/modules/aggregator/config-templates/aggregator.php b/modules/aggregator/config-templates/aggregator.php
index 868ced2a562adf5227b8569ce61979a2a9a02fe7..e17552425fc9468846744effa3fb224e72f3adbc 100644
--- a/modules/aggregator/config-templates/aggregator.php
+++ b/modules/aggregator/config-templates/aggregator.php
@@ -4,7 +4,7 @@
 $config = array(
 
 	/* List of aggregators. */
-	'aggragators' => array(
+	'aggregators' => array(
 		'example' => array(
 			array('type' => 'flatfile'),  /* Metadata from metadata-directory. */
 			array('type' => 'xml', 'url' => 'https://idp.example.org/Metadata'),
diff --git a/modules/aggregator/www/index.php b/modules/aggregator/www/index.php
index aa1e88eabceccac88c4c652ee62bb9ef60a6a10d..282aa97f51f462a20c6ee7be505943070e2cc337 100644
--- a/modules/aggregator/www/index.php
+++ b/modules/aggregator/www/index.php
@@ -1,19 +1,31 @@
 <?php
 
-/* Types of metadata. */
-$metadataSets = array(
-	'saml20-idp-remote',
-	'saml20-sp-remote',
-	'shib13-idp-remote',
-	'shib13-sp-remote',
-	);
-
 $globalConfig = SimpleSAML_Configuration::getInstance();
 $aggregatorConfig = SimpleSAML_Configuration::getConfig('aggregator.php');
 
 
 $reconstruct = $aggregatorConfig->getBoolean('reconstruct', FALSE);
-$aggregators = $aggregatorConfig->getArray('aggragators');
+$aggregators = $aggregatorConfig->getArray('aggregators');
+
+$metadataSets = array('saml20-idp-remote', 'saml20-sp-remote', 'shib13-idp-remote', 'shib13-sp-remote');
+if ($aggregatorConfig->hasValue('default-set')) {
+	$metadataSets = $aggregatorConfig->getArray('default-set');
+}
+if (isset($_REQUEST['set'])) {
+	switch($_REQUEST) {
+		case 'saml2' :
+			$metadataSets = array('saml20-idp-remote', 'saml20-sp-remote'); break;
+		case 'shib13' :
+			$metadataSets = array('shib13-idp-remote', 'shib13-sp-remote'); break;
+		case 'idp' :
+			$metadataSets = array('saml20-idp-remote', 'shib13-idp-remote'); break;
+		case 'sp' :
+			$metadataSets = array('saml20-sp-remote', 'shib13-sp-remote'); break;
+		
+		default:
+			$metadataSets = array($_REQUEST['set']);
+	}
+}
 
 if (!array_key_exists('id', $_GET)) {
 	$t = new SimpleSAML_XHTML_Template($globalConfig, 'aggregator:list.php');
diff --git a/modules/metarefresh/lib/MetaLoader.php b/modules/metarefresh/lib/MetaLoader.php
index a9949a0705441e6e55d6b349710010193f23271e..83e181ba2f1a6eda0839954d22d54917858d9334 100644
--- a/modules/metarefresh/lib/MetaLoader.php
+++ b/modules/metarefresh/lib/MetaLoader.php
@@ -29,8 +29,13 @@ class sspmod_metarefresh_MetaLoader {
 	 * @param $src  Filename of the metadata file.
 	 */
 	public function loadSource($source) {
-
-		$entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsFile($source['src']);
+		
+		$entities = array();
+		try {
+			$entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsFile($source['src']);
+		} catch(Exception $e) {
+			SimpleSAML_Logger::warning('metarefresh: Failed to retrieve metadata. ' . $e->getMessage());
+		}
 		$ca = NULL;
 		foreach($entities as $entity) {
 			if(array_key_exists('validateFingerprint', $source) && $source['validateFingerprint'] !== NULL) {