diff --git a/bin/translation.php b/bin/translation.php
index 0ffc820b55e25b699bc4a22f939ae13e5c6ebb4e..479e62737219d1c856d8021262bba218d703b0e1 100755
--- a/bin/translation.php
+++ b/bin/translation.php
@@ -58,8 +58,6 @@ switch($action) {
 	
 	case 'push':
 
-		#$content = file_get_contents($base . 'export.php?aid=' . $application . '&type=translation&file=' . $basefile);
-		#file_put_contents($fileWithoutExt . '.translation.json' , $content);
 		push($file, $basefile, $application, $type);
 		
 		break;
diff --git a/lib/SimpleSAML/Auth/TimeLimitedToken.php b/lib/SimpleSAML/Auth/TimeLimitedToken.php
index c4b126d39ecd6a6ce9055c5d7116a37e5b2344b0..5a59b7a85aca91335d7a81f90b9a4d44bd6ab551 100644
--- a/lib/SimpleSAML/Auth/TimeLimitedToken.php
+++ b/lib/SimpleSAML/Auth/TimeLimitedToken.php
@@ -39,9 +39,6 @@ class SimpleSAML_Auth_TimeLimitedToken {
 	 * Calculate the given time slot for a given offset.
 	 */
 	private function calculate_time_slot($offset) {
-	
-		#echo 'lifetime is: ' . $this->lifetime;
-		
 		$timeslot = floor( (time() - $offset) / ($this->lifetime + $this->skew) );
 		return $timeslot;
 	}
@@ -51,10 +48,6 @@ class SimpleSAML_Auth_TimeLimitedToken {
 	 */
 	private function calculate_tokenvalue($offset) {
 		// A secret salt that should be randomly generated for each installation.
-		#echo 'Secret salt is: ' . $this->secretSalt;
-		
-		#echo '<p>Calculating sha1( ' . $this->calculate_time_slot($offset) . ':' . $this->secretSalt . '  )<br />';
-		
 		return sha1( $this->calculate_time_slot($offset) . ':' . $this->secretSalt);
 	}
 	
@@ -74,10 +67,6 @@ class SimpleSAML_Auth_TimeLimitedToken {
 		$splittedtoken = explode('-', $token);
 		$offset = hexdec($splittedtoken[0]);
 		$value  = $splittedtoken[1];
-		
-		
-		#echo 'compare [' . $this->calculate_tokenvalue($offset). '] with [' . $value . '] offset was [' . $offset. ']';
-		
 		return ($this->calculate_tokenvalue($offset) === $value);
 	}
 	
diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 4186eb97fc373d4d6676f63d87db870856914170..d259aebab116f1175ab94f9e9ecdc9afc9b38b0c 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -413,7 +413,6 @@ class SimpleSAML_XHTML_Template {
 
 		$translated = $this->getTranslation($tagData);
 
-#		if (!empty($replacements)){		echo('<pre> [' . $tag . ']'); print_r($replacements); exit; }
 		foreach ($replacements as $k => $v) {
 			/* try to translate if no replacement is given */
 			if ($v == NULL) $v = $this->t($k);
diff --git a/lib/SimpleSAML/XML/Parser.php b/lib/SimpleSAML/XML/Parser.php
index b3096660c3340647e108bdf509559134eae28d9c..d73472d26c0cf84009d43d0d2b518502d990b430 100644
--- a/lib/SimpleSAML/XML/Parser.php
+++ b/lib/SimpleSAML/XML/Parser.php
@@ -10,11 +10,8 @@ class SimpleSAML_XML_Parser  {
 
 	var $simplexml = null;
 
-	
-	function __construct($xml) {
-		#parent::construct($xml);
+	function __construct($xml) {;
 		$this->simplexml = new SimpleXMLElement($xml);
-		
 		$this->simplexml->registerXPathNamespace('saml2',     'urn:oasis:names:tc:SAML:2.0:assertion');
 		$this->simplexml->registerXPathNamespace('saml2meta', 'urn:oasis:names:tc:SAML:2.0:metadata');
 		$this->simplexml->registerXPathNamespace('ds',        'http://www.w3.org/2000/09/xmldsig#');
diff --git a/modules/adfs/lib/IdP/ADFS.php b/modules/adfs/lib/IdP/ADFS.php
index c60e42f1142977e3fc2146030cb9340d3383240a..a96e005ee9b044e9ff553eeb6e04e634b4fa5921 100644
--- a/modules/adfs/lib/IdP/ADFS.php
+++ b/modules/adfs/lib/IdP/ADFS.php
@@ -34,8 +34,6 @@ class sspmod_adfs_IdP_ADFS {
 
 		$state = array(
 			'Responder' => array('sspmod_adfs_IdP_ADFS', 'sendResponse'),
-//			SimpleSAML_Auth_State::EXCEPTION_HANDLER_FUNC => array('sspmod_adfs_IdP', 'handleAuthError'),
-//			SimpleSAML_Auth_State::RESTART => $sessionLostURL,
 			'SPMetadata' => $spMetadata->toArray(),
 			'ForceAuthn' => $forceAuthn,
 			'isPassive' => $isPassive,
@@ -46,7 +44,6 @@ class sspmod_adfs_IdP_ADFS {
 	}
 
 	public static function ADFS_GenerateResponse($issuer, $target, $nameid, $attributes) {
-		#$nameid = 'hans@surfnet.nl';
 		$issueInstant = SimpleSAML\Utils\Time::generateTimestamp();
 		$notBefore = SimpleSAML\Utils\Time::generateTimestamp(time() - 30);
 		$assertionExpire = SimpleSAML\Utils\Time::generateTimestamp(time() + 60 * 5);
@@ -185,8 +182,6 @@ class sspmod_adfs_IdP_ADFS {
 		$state = array(
 			'Responder' => array('sspmod_adfs_IdP_ADFS', 'sendLogoutResponse'),
 		);
-		//$spEntityId = NULL;
-		//$assocId = 'adfs:' . $spEntityId;
 		$assocId = NULL;
 		// TODO: verify that this is really no problem for: 
 		//       a) SSP, because there's no caller SP...
@@ -199,7 +194,6 @@ class sspmod_adfs_IdP_ADFS {
 		$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 		$idpMetadata = $idp->getConfig();
 		$spMetadata = $metadata->getMetaDataConfig($association['adfs:entityID'], 'adfs-sp-remote');
-		// 'https://adfs-test.showcase.surfnet.nl/adfs/ls/?wa=wsignoutcleanup1.0&wreply=https%3A%2F%2Flocalhost%2Fsimplesaml');
 		$returnTo = SimpleSAML_Module::getModuleURL('adfs/idp/prp.php?assocId=' . urlencode($association["id"]) . '&relayState=' . urlencode($relayState));
 		return $spMetadata->getValue('prp') . '?' . 'wa=wsignoutcleanup1.0&wreply=' . urlencode($returnTo);
 	}
diff --git a/modules/authYubiKey/libextinc/Yubico.php b/modules/authYubiKey/libextinc/Yubico.php
index 9cdd51cb0d03abb53aede6439337c79683ba0536..15cd461d375a15347c21c2c51ecc2e8ce80b49d8 100644
--- a/modules/authYubiKey/libextinc/Yubico.php
+++ b/modules/authYubiKey/libextinc/Yubico.php
@@ -40,8 +40,6 @@
    * @link        http://yubico.com/
    */
 
-#require_once 'PEAR.php';
-
 /**
  * Class for verifying Yubico One-Time-Passcodes
  *
diff --git a/modules/authfacebook/extlibinc/base_facebook.php b/modules/authfacebook/extlibinc/base_facebook.php
index 44ac08e880647bdc3cb67c5d2769be4fddf66518..36a1c6f0c75a1671afea36822a211cdd6ac12a57 100644
--- a/modules/authfacebook/extlibinc/base_facebook.php
+++ b/modules/authfacebook/extlibinc/base_facebook.php
@@ -1282,8 +1282,6 @@ abstract class BaseFacebook
     if (php_sapi_name() != 'cli') {
       error_log($msg);
     }
-    // uncomment this if you want to see the errors on the page
-    // print 'error_log: '.$msg."\n";
     // @codeCoverageIgnoreEnd
   }
 
diff --git a/modules/authmyspace/lib/Auth/Source/MySpace.php b/modules/authmyspace/lib/Auth/Source/MySpace.php
index b6514661d7403add3d608bac1aeee2653e391a41..8f00b1cb0f990894351dd9c15b720a62cc022851 100644
--- a/modules/authmyspace/lib/Auth/Source/MySpace.php
+++ b/modules/authmyspace/lib/Auth/Source/MySpace.php
@@ -93,9 +93,6 @@ class sspmod_authmyspace_Auth_Source_MySpace extends SimpleSAML_Auth_Source {
 		SimpleSAML_Logger::debug("Got an access token from the OAuth service provider [" .
 			$accessToken->key . "] with the secret [" . $accessToken->secret . "]");
 
-		// API depricated on 20th September 2010
-		//$userdata = $consumer->getUserInfo('http://api.myspace.com/v1/user.json', $accessToken);
-
 		// People API -  http://developerwiki.myspace.com/index.php?title=People_API
 		$userdata = $consumer->getUserInfo('http://api.myspace.com/1.0/people/@me/@self?fields=@all', $accessToken);
 
diff --git a/modules/consent/lib/Consent/Store/Database.php b/modules/consent/lib/Consent/Store/Database.php
index daae61c4137250fbc43917fd1bb7c31b86575877..9223cfd471bbe8855438207740ebe5ef18039f78 100644
--- a/modules/consent/lib/Consent/Store/Database.php
+++ b/modules/consent/lib/Consent/Store/Database.php
@@ -482,14 +482,7 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
             $driver_options[PDO::ATTR_TIMEOUT] = $this->_timeout;
         }
 
-        // @TODO Cleanup this section
-        //try {
         $this->_db = new PDO($this->_dsn, $this->_username, $this->_password, $driver_options);
-        // 		} catch (PDOException $e) {
-        // 			SimpleSAML_Logger::error('consent:Database - Failed to connect to \'' .
-        // 				$this->_dsn . '\': '. $e->getMessage());
-        // 			$this->db = false;
-        // 		}
 
         return $this->_db;
     }
diff --git a/modules/consentAdmin/templates/consentadmin.php b/modules/consentAdmin/templates/consentadmin.php
index a07cd2286e51a6702278e3dbcbff42fe904adc93..aac3c499ff3083d6941d3421f9ea0e9b1dfea72e 100644
--- a/modules/consentAdmin/templates/consentadmin.php
+++ b/modules/consentAdmin/templates/consentadmin.php
@@ -68,7 +68,6 @@ span.showhide {
 			<?php
 			$spList = $this->data['spList'];
 			$show_spid = 0;
-			//$show_hide_attributes= $this->t('show_hide_attributes');
 			$show_text = $this->t('show');
 			$hide_text = $this->t('hide');
 			$attributes_text = $this->t('attributes_text');
diff --git a/modules/consentSimpleAdmin/www/consentStats.php b/modules/consentSimpleAdmin/www/consentStats.php
index 92240e10b98f6423803b4bae398e4e6b196977eb..a9339c052bdb4895c2f864b7ae1e23b8fd178974 100644
--- a/modules/consentSimpleAdmin/www/consentStats.php
+++ b/modules/consentSimpleAdmin/www/consentStats.php
@@ -20,8 +20,6 @@ $consent_storage = sspmod_consent_Store::parseStoreConfig($consentconfig->getVal
 // Get all consents for user
 $stats = $consent_storage->getStatistics();
 
-#print_r($stats); exit;
-
 // Init template
 $t = new SimpleSAML_XHTML_Template($config, 'consentSimpleAdmin:consentstats.php');
 
diff --git a/modules/core/hooks/hook_sanitycheck.php b/modules/core/hooks/hook_sanitycheck.php
index d81ef25bca1e9c97a9db0cc74774b1c7252dda72..b0848d3fc986b3d365c621bb4d83e78d745c0e1d 100644
--- a/modules/core/hooks/hook_sanitycheck.php
+++ b/modules/core/hooks/hook_sanitycheck.php
@@ -23,12 +23,12 @@ function core_hook_sanitycheck(&$hookinfo) {
 		$hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly';
 	}
 	
-	if (version_compare(phpversion(), '5.2', '>=')) {
+	if (version_compare(phpversion(), '5.3', '>=')) {
 		$hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. Great.';
 	} elseif( version_compare(phpversion(), '5.1.2', '>=')) {
 		$hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. It\'s recommended to upgrade to >= 5.2';
 	} else {
-		$hookinfo['errors'][] = '[core] You are running PHP version ' . phpversion() . '. SimpleSAMLphp requires version >= 5.1.2, and reccomends version >= 5.2. Please upgrade!';
+		$hookinfo['errors'][] = '[core] You are running PHP version ' . phpversion() . '. SimpleSAMLphp requires version >= 5.3. Please upgrade!';
 	}
 	
 	$info = array();
@@ -40,7 +40,6 @@ function core_hook_sanitycheck(&$hookinfo) {
 	foreach($info AS $mi => $i) {
 		if (isset($i['dependencies']) && is_array($i['dependencies'])) {
 			foreach ($i['dependencies'] AS $dep) {
-				// $hookinfo['info'][] = '[core] Module ' . $mi . ' requires ' . $dep;
 				if (!in_array($dep, $availmodules)) {
 					$hookinfo['errors'][] = '[core] Module dependency not met: ' . $mi . ' requires ' . $dep;
 				}
diff --git a/modules/core/lib/ModuleDefinition.php b/modules/core/lib/ModuleDefinition.php
index 64106e628940b70d180a434058276f974d5bc605..f63309640f8ccc9d206fdef837c6f83e026d6321 100644
--- a/modules/core/lib/ModuleDefinition.php
+++ b/modules/core/lib/ModuleDefinition.php
@@ -110,9 +110,7 @@ class sspmod_core_ModuleDefinition {
 
 		$remoteDef = self::load($this->def['definition'], 'remote');
 		$remoteVersion = $remoteDef->getVersion($branch);
-		
-		#echo ' Comparing versions localĂ‚ [' . $thisVersion . '] and remote [' . $remoteVersion . ']' . "\n";
-		
+
 		return version_compare($remoteVersion, $thisVersion, '>');
 	}
 	
diff --git a/modules/core/lib/ModuleInstaller.php b/modules/core/lib/ModuleInstaller.php
index a35cc3d0753a1989a625f03e8416964a39fd0a08..5dde6fe55852ec63a533d259bb03a3adaa5d332c 100644
--- a/modules/core/lib/ModuleInstaller.php
+++ b/modules/core/lib/ModuleInstaller.php
@@ -20,11 +20,6 @@ class sspmod_core_ModuleInstaller {
 		$access = $this->module->getAccess($branch);
 		
 		switch($access['type']) {
-			// case 'svn' :
-			// 	$this->requireInstalled();
-			// 	$this->remove($access);
-			// 	break;
-			
 			default:
 				$this->requireInstalled();
 				$this->removeModuleDir($access);
diff --git a/modules/core/lib/Storage/SQLPermanentStorage.php b/modules/core/lib/Storage/SQLPermanentStorage.php
index 14966571a63139f4a74a50defe2754299016d458..0a1a925b69dee6d6427b277678ab5ba065c5b04c 100644
--- a/modules/core/lib/Storage/SQLPermanentStorage.php
+++ b/modules/core/lib/Storage/SQLPermanentStorage.php
@@ -99,8 +99,6 @@ class sspmod_core_Storage_SQLPermanentStorage {
 			"key2 = '" . sqlite_escape_string($key2) . "' AND " . 
 			"type = '" . sqlite_escape_string($type) . "'";
 		$results = $this->db->queryExec($query);
-		# echo $query;
-		# echo $this->db>changes;
 		return $results;
 	}
 
@@ -109,9 +107,7 @@ class sspmod_core_Storage_SQLPermanentStorage {
 		$condition = self::getCondition($type, $key1, $key2);
 		$query = "SELECT * FROM data WHERE " . $condition;
 		$results = $this->db->arrayQuery($query, SQLITE_ASSOC);
-		
-#		echo '<pre>type: ' . $type . ' key1:' . $key1 . '   ' . $query; print_r($results); exit;
-		
+
 		if (count($results) !== 1) return NULL;
 		
 		$res = $results[0];
diff --git a/modules/core/www/show_metadata.php b/modules/core/www/show_metadata.php
index 5e90a8b6a00deb10b30f52591256d0b9b7d9b7c0..8c20104c521634c42bff7645bc961805f9befd37 100644
--- a/modules/core/www/show_metadata.php
+++ b/modules/core/www/show_metadata.php
@@ -21,10 +21,6 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 
 $m = $metadata->getMetadata($_REQUEST['entityid'], $_REQUEST['set']);
 
-// echo('<pre>'); print_r($m);
-// exit;
-
-
 $t = new SimpleSAML_XHTML_Template($config, 'core:show_metadata.tpl.php');
 $t->data['pageid'] = 'show_metadata';
 $t->data['header'] = 'simpleSAMLphp Show Metadata';
diff --git a/modules/discojuice/templates/central.tpl.php b/modules/discojuice/templates/central.tpl.php
index 8067e168041f104f291c21cba5600f5d9e0e2401..0695b675b3bfe6e233978f52811b5c4edbb49f6f 100644
--- a/modules/discojuice/templates/central.tpl.php
+++ b/modules/discojuice/templates/central.tpl.php
@@ -42,9 +42,6 @@ header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
 				json_encode($this->data['hostedConfig'][4]) .
 			');';
 
-	// echo "	djc.country = false;\n";
-	// echo "	djc.showLocationInfo = false;\n";
-	
 	if (!$this->data['enableCentralStorage']) {
 		echo "	delete djc.disco;\n";
 	}
diff --git a/modules/discopower/lib/PowerIdPDisco.php b/modules/discopower/lib/PowerIdPDisco.php
index 0702141dd00150677f7f129ae8a00c7f0853fda7..ef50dc6e0db801c13d4070e07c54345910081472 100644
--- a/modules/discopower/lib/PowerIdPDisco.php
+++ b/modules/discopower/lib/PowerIdPDisco.php
@@ -99,7 +99,6 @@ class sspmod_discopower_PowerIdPDisco extends SimpleSAML_XHTML_IdPDisco {
 	 * This function will structure the idp list in a hierarchy based upon the tags.
 	 */
 	protected function idplistStructured($list) {
-		# echo '<pre>'; print_r($list); exit;
 		$slist = array();
 		
 		$order = $this->discoconfig->getValue('taborder');
diff --git a/modules/discopower/templates/disco-tpl.php b/modules/discopower/templates/disco-tpl.php
index f3c981412cfb12181e52302e29291529de15d1bf..8e6c0c5e48ec81c1f1103c353a9d7f8299c92c69 100644
--- a/modules/discopower/templates/disco-tpl.php
+++ b/modules/discopower/templates/disco-tpl.php
@@ -50,17 +50,6 @@ if (!empty($faventry)) $this->data['autofocus'] = 'favouritesubmit';
 
 $this->includeAtTemplateBase('includes/header.php');
 
-// foreach ($this->data['idplist'] AS $slist) {
-// 	foreach ($slist AS $idpentry) {
-// 		if (isset($idpentry['name']))
-// 			$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']);
-// 		if (isset($idpentry['description']))
-// 			$this->includeInlineTranslation('idpdesc_' . $idpentry['entityid'], $idpentry['description']);
-// 	}
-// }
-// 
-
-
 function showEntry($t, $metadata, $favourite = FALSE) {
 	
 	$basequerystring = '?' . 
@@ -73,21 +62,11 @@ function showEntry($t, $metadata, $favourite = FALSE) {
 	
 	$html .= '' . htmlspecialchars(getTranslatedName($t, $metadata)) . '';
 
-	#print_r($metadata['scopes']); 
-
-	// if (!empty($idpentry['description'])) {
-	// 	$html .= '	<p>' . htmlspecialchars($t->t('idpdesc_' . $metadata['entityid'])) . '<br />';
-	// }
-	
 	if(array_key_exists('icon', $metadata) && $metadata['icon'] !== NULL) {
 		$iconUrl = SimpleSAML_Utilities::resolveURL($metadata['icon']);
 		$html .= '<img alt="Icon for identity provider" class="entryicon" src="' . htmlspecialchars($iconUrl) . '" />';
 	}
-	
-	// $html .= '<input id="preferredidp" type="submit" name="idp_' .
-	// 	htmlspecialchars($metadata['entityid']) . '" value="' .
-	// 	$t->t('select') . '" /></p>';
-	
+
 	$html .= '</a>';
 	
 	return $html;
@@ -101,7 +80,6 @@ function showEntry($t, $metadata, $favourite = FALSE) {
 <?php
 
 function getTranslatedName($t, $metadata) {
-#	if (is_null($metadata)) throw new Exception();
 	if (isset($metadata['UIInfo']['DisplayName'])) {
 		$displayName = $metadata['UIInfo']['DisplayName'];
 		assert('is_array($displayName)'); // Should always be an array of language code -> translation.
@@ -176,10 +154,6 @@ foreach( $this->data['idplist'] AS $tab => $slist) {
 	echo '<div id="' . $tab . '">';
 
 	if (!empty($slist)) {
-		
-		// echo 'Favourite :: ' . $this->data['preferredidp']; 
-		// echo '<pre>';
-		// print_r($slist); exit;
 
 		echo('	<div class="inlinesearch">');
 		echo('	<p>Incremental search...</p>');
diff --git a/modules/expirycheck/lib/Auth/Process/ExpiryDate.php b/modules/expirycheck/lib/Auth/Process/ExpiryDate.php
index 45a371903bf446ea254a978be75d32c095a2c151..1436f169e4cb99b64afc51d65b948061ac982cb9 100644
--- a/modules/expirycheck/lib/Auth/Process/ExpiryDate.php
+++ b/modules/expirycheck/lib/Auth/Process/ExpiryDate.php
@@ -76,7 +76,6 @@ class sspmod_expirycheck_Auth_Process_ExpiryDate extends SimpleSAML_Auth_Process
 	 *
 	 */
 	public function shWarning(&$state, $expireOnDate, $warndaysbefore) {
-		#date_default_timezone_set('Europe/Ljubljana');
 		$now = time();
 		$end = $expireOnDate;
 
diff --git a/modules/expirycheck/templates/about2expire.php b/modules/expirycheck/templates/about2expire.php
index 6b7752dab185680224ec41416adc22bea297ce81..f695cdb00216d4fd99e28f0478cb1bf14b3ca8f9 100644
--- a/modules/expirycheck/templates/about2expire.php
+++ b/modules/expirycheck/templates/about2expire.php
@@ -16,9 +16,6 @@
  * @package simpleSAMLphp
  */
 
-
-//$this->data['header'] = $this->t('{expirycheck:expwarning:warning_header}');
-
 # netid will expire today
 if ($this->data['daysleft'] == 0) {
 	$this->data['header'] = $this->t('{expirycheck:expwarning:warning_header_today}', array(
@@ -63,7 +60,6 @@ else {
 
 }
 
-//$this->data['header'] = str_replace("%DAYSLEFT%", $this->data['daysleft'], str_replace("%NETID%", $this->data['netId'], $this->t('{expirycheck:expwarning:warning_header}')));
 $this->data['autofocus'] = 'yesbutton';
 
 $this->includeAtTemplateBase('includes/header.php');
diff --git a/modules/logpeek/lib/File/reverseRead.php b/modules/logpeek/lib/File/reverseRead.php
index 164629baef042b25172c456bf17cdb738751ef7c..501c0d2e8b8da2322e4d2583662248b2d1a1d3bd 100644
--- a/modules/logpeek/lib/File/reverseRead.php
+++ b/modules/logpeek/lib/File/reverseRead.php
@@ -83,9 +83,7 @@ class sspmod_logpeek_File_reverseRead{
 		
 		fseek($this->fileHandle, $this->blockStart, SEEK_SET);
 		$buff = fread($this->fileHandle, $splits);
-		
-		// $buff = stream_get_contents($this->fileHandle, $splits, $this->blockStart);
-		
+
 		return $buff;
 	}
 	
@@ -182,7 +180,6 @@ class sspmod_logpeek_File_reverseRead{
 		}
 		
 		return $lastLines;
-		// return str_replace("\r", '', implode('', array_reverse($buff1)));
 	}
 	
 	
diff --git a/modules/memcacheMonitor/templates/memcachestat.tpl.php b/modules/memcacheMonitor/templates/memcachestat.tpl.php
index a3e2d108179d493ebf9cce7d58c2a44432cc9c9c..e763fedf986baacf0aff26a133fb492330c49b98 100644
--- a/modules/memcacheMonitor/templates/memcachestat.tpl.php
+++ b/modules/memcacheMonitor/templates/memcachestat.tpl.php
@@ -58,7 +58,6 @@ foreach($column_titles as $ct) {
 foreach($table as $row_title => $row_data) {
 	echo '<tr>' . "\n";
 	echo '<th class="rowtitle" style="text-align: right">' . $this->t('{memcacheMonitor:memcachestat:' . $row_title . '}') . '</th>' . "\n";
-#	echo '<th class="rowtitle" style="text-align: right">' . $row_title . '</th>' . "\n";
 
 	foreach($column_titles as $ct) {
 		echo '<td>';
@@ -77,10 +76,6 @@ foreach($table as $row_title => $row_data) {
 </table>
 
 <?php
-
-
-#echo('<pre>'); print_r($this->data['statsraw']); exit;
-
 if (array_key_exists('bytes', $this->data['statsraw']) && array_key_exists('limit_maxbytes', $this->data['statsraw'])) {
 	foreach($this->data['statsraw']['bytes'] as $key => $row_data) {
 		echo ('<h3>Storage usage on [' . $key . ']</h3>');
@@ -93,9 +88,4 @@ if (array_key_exists('bytes', $this->data['statsraw']) && array_key_exists('limi
 	}
 }
 
-?>
-
-
-
-<?php
 $this->includeAtTemplateBase('includes/footer.php');
diff --git a/modules/metaedit/lib/MetaEditor.php b/modules/metaedit/lib/MetaEditor.php
index f922be82e005b7006737045e31011601d8ab848a..e2d2d6e5e50811d4fc9c81b9fc6a01593cf055bc 100644
--- a/modules/metaedit/lib/MetaEditor.php
+++ b/modules/metaedit/lib/MetaEditor.php
@@ -38,7 +38,6 @@ class sspmod_metaedit_MetaEditor {
 		$this->getStandardField($request, $metadata, 'description');
 		$this->getEndpointField($request, $metadata, 'AssertionConsumerService', SAML2_Const::BINDING_HTTP_POST, TRUE);
 		$this->getEndpointField($request, $metadata, 'SingleLogoutService', SAML2_Const::BINDING_HTTP_REDIRECT, FALSE);
-		// $this->getStandardField($request, $metadata, 'certFingerprint');
 		$metadata['updated'] = time();
 		
 		if ($override) {
@@ -109,8 +108,6 @@ class sspmod_metaedit_MetaEditor {
 		if (array_key_exists($key, $metadata)) {
 			$value = htmlspecialchars($metadata[$key]);
 		}
-		#echo '<tr><td><pre>'; print_r($metadata); echo '</pre></td></tr>';
-		
 		if ($textarea) {
 			return '<tr><td class="name">' . $name . '</td><td class="data">
 			<textarea name="field_' . $key . '" rows="5" cols="50">' . $value . '</textarea></td></tr>';
@@ -156,10 +153,7 @@ class sspmod_metaedit_MetaEditor {
 			'<div id="tabdiv">' .
 			'<ul>' .
 			'<li><a href="#basic">Name and descrition</a></li>' . 
-			'<li><a href="#saml">SAML 2.0</a></li>' . 
-			// '<li><a href="#attributes">Attributes</a></li>' . 
-			// '<li><a href="#orgs">Organizations</a></li>' . 
-			// '<li><a href="#contacts">Contacts</a></li>' . 
+			'<li><a href="#saml">SAML 2.0</a></li>' .
 			'</ul>' .
 			'<div id="basic"><table class="formtable">' .
 				$this->standardField($metadata, 'entityid', 'EntityID') .
@@ -172,8 +166,6 @@ class sspmod_metaedit_MetaEditor {
 			'</table></div><div id="saml"><table class="formtable">' .
 				$this->endpointField($metadata, 'AssertionConsumerService', 'AssertionConsumerService endpoint') .
 				$this->endpointField($metadata, 'SingleLogoutService', 'SingleLogoutService endpoint') .
-				// $this->standardField($metadata, 'certFingerprint', 'Certificate Fingerprint') .			
-				
 			'</table></div>' .
 			'</div>' .
 			'<input type="submit" name="submit" value="Save" style="margin-top: 5px" />' .
diff --git a/modules/metaedit/templates/metalist.php b/modules/metaedit/templates/metalist.php
index 368fe7838208a8422486dd90225abd8fe5686699..04b39cdcaed14fe44d7dd8c2480fd6e523fdbde1 100644
--- a/modules/metaedit/templates/metalist.php
+++ b/modules/metaedit/templates/metalist.php
@@ -2,12 +2,6 @@
 
 $this->data['jquery'] = array('version' => '1.6', 'core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
 $this->data['head']  = '<link rel="stylesheet" type="text/css" href="/' . $this->data['baseurlpath'] . 'module.php/metaedit/resources/style.css" />' . "\n";
-// $this->data['head'] .= '<script type="text/javascript">
-// $(document).ready(function() {
-// 	$("#tabdiv").tabs();
-// });
-// </script>';
-
 $this->includeAtTemplateBase('includes/header.php');
 
 
diff --git a/modules/metaedit/templates/xmlimport.tpl.php b/modules/metaedit/templates/xmlimport.tpl.php
index 59ca4b899919c65ff32269f9b58cdd55d8cd14a0..68f046cdd199edf3afd1961bbdf12b6d0baab339 100644
--- a/modules/metaedit/templates/xmlimport.tpl.php
+++ b/modules/metaedit/templates/xmlimport.tpl.php
@@ -1,16 +1,6 @@
 <?php
-
-// $this->data['jquery'] = array('version' => '1.6', 'core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
-// $this->data['head']  = '<link rel="stylesheet" type="text/css" href="/' . $this->data['baseurlpath'] . 'module.php/metaedit/resources/style.css" />' . "\n";
-// $this->data['head'] .= '<script type="text/javascript">
-// $(document).ready(function() {
-// 	$("#tabdiv").tabs();
-// });
-// </script>';
-
 $this->includeAtTemplateBase('includes/header.php');
 
-
 echo('<h1>Import SAML 2.0 XML Metadata</h1>');
 
 echo('<form method="post" action="edit.php">');
diff --git a/modules/metaedit/www/edit.php b/modules/metaedit/www/edit.php
index ea110f57e3298b0a31cf205d683ea6d4281ccaf9..ddbf207813ec8d18a55a6e342c7037a772aa7ec4 100644
--- a/modules/metaedit/www/edit.php
+++ b/modules/metaedit/www/edit.php
@@ -40,8 +40,6 @@ if (array_key_exists('entityid', $_REQUEST)) {
 	$metadata['AssertionConsumerService'] = array(SimpleSAML_Utilities::getDefaultEndpoint($metadata['AssertionConsumerService'], array(SAML2_Const::BINDING_HTTP_POST)));
 	$metadata['SingleLogoutService'] = array(SimpleSAML_Utilities::getDefaultEndpoint($metadata['SingleLogoutService'], array(SAML2_Const::BINDING_HTTP_REDIRECT)));
 
-	#echo '<pre>'; print_r($metadata); exit;
-
 } else {
 	$metadata = array(
 		'owner' => $userid,
diff --git a/modules/metarefresh/lib/MetaLoader.php b/modules/metarefresh/lib/MetaLoader.php
index e8d869677b00622025ea36aac0f91e4e960f6a42..93dab47c95933c72d35e8da9610a59650533d65f 100644
--- a/modules/metarefresh/lib/MetaLoader.php
+++ b/modules/metarefresh/lib/MetaLoader.php
@@ -180,7 +180,6 @@ class sspmod_metarefresh_MetaLoader {
 				foreach($this->oldMetadataSrc->getMetadataSet($type) as $entity) {
 					if(array_key_exists('metarefresh:src', $entity)) {
 						if($entity['metarefresh:src'] == $source['src']) {
-							//SimpleSAML_Logger::debug('Re-using cached metadata for ' . $entity['entityid']);
 							$this->addMetadata($source['src'], $entity, $type);
 						}
 					}
@@ -291,10 +290,6 @@ class sspmod_metarefresh_MetaLoader {
 		}
 	
 		if (isset($template)) {
-// 			foreach($metadata AS $mkey => $mentry) {
-// 				echo '<pre>'; print_r($metadata); exit;
-// 				$metadata[$mkey] = array_merge($mentry, $template);
-// 			}
 			$metadata = array_merge($metadata, $template);
 		}
 	
@@ -341,7 +336,7 @@ class sspmod_metarefresh_MetaLoader {
 			$md = array_merge($md, $elements);
 		}
 		
-		#$metadata, $attributemap, $prefix, $suffix
+		// $metadata, $attributemap, $prefix, $suffix
 		$arp = new sspmod_metarefresh_ARP($md, 
 			$config->getValue('attributemap', ''),  
 			$config->getValue('prefix', ''),  
diff --git a/modules/oauth/bin/demo.php b/modules/oauth/bin/demo.php
index b1dcf520cc5caeea24b3f94dd4e60c148ac0abcd..f224ac32985188d408bab1c00c538edd0457923c 100755
--- a/modules/oauth/bin/demo.php
+++ b/modules/oauth/bin/demo.php
@@ -22,7 +22,6 @@ try {
 	// Needed in order to make session_start to be called before output is printed.
 	$session = SimpleSAML_Session::getSessionFromRequest();
 
-	//$baseurl = (isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 'https://foodle.feide.no/simplesaml');
 	$baseurl = (isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 'http://mars.foodle.local/simplesaml');
 	$key = (isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : 'key');
 	$secret = (isset($_SERVER['argv'][3]) ? $_SERVER['argv'][3] : 'secret');
diff --git a/modules/oauth/lib/Consumer.php b/modules/oauth/lib/Consumer.php
index 6a1684118ed25ed944ce5dc8bc258cc0b53f907a..8e3e5aed60fb4da5facb4b81e4c5e10c73abcb01 100644
--- a/modules/oauth/lib/Consumer.php
+++ b/modules/oauth/lib/Consumer.php
@@ -130,8 +130,6 @@ class sspmod_oauth_Consumer {
 		$opts = array(
 			'ssl' => array(
 				'verify_peer' => FALSE,
-				// 'cafile' => $file,
-				// 'local_cert' => $spKeyCertFile,
 				'capture_peer_cert' => TRUE,
 				'capture_peer_chain' => TRUE,
 			),
@@ -158,7 +156,6 @@ class sspmod_oauth_Consumer {
 			$opts = stream_context_create($opts);
 		}
 		$data = file_get_contents($data_req->to_url(), FALSE, $opts);
-		#print_r($data);
 
 		$dataDecoded = json_decode($data, TRUE);
 		return $dataDecoded;
diff --git a/modules/oauth/lib/OAuthStore.php b/modules/oauth/lib/OAuthStore.php
index 4e6960a311cdb7b4bc89344cab6d8e6bde81e582..6a239a6c04e51d5d5cc76161356893b1d3e55fdf 100644
--- a/modules/oauth/lib/OAuthStore.php
+++ b/modules/oauth/lib/OAuthStore.php
@@ -111,7 +111,6 @@ class sspmod_oauth_OAuthStore extends OAuthDataStore {
 		$callback = NULL;
 		if ($consumer['value']['callback_url']) $callback = $consumer['value']['callback_url'];
 
-		// SimpleSAML_Logger::info('OAuth consumer dump(' . var_export($consumer, TRUE) . ')');
 		if ($consumer['value']['RSAcertificate']) {
 			return new OAuthConsumer($consumer['value']['key'], $consumer['value']['RSAcertificate'], $callback);
 		} else {
@@ -159,7 +158,6 @@ class sspmod_oauth_OAuthStore extends OAuthDataStore {
     function new_access_token($requestToken, $consumer, $verifier = null) {
 		SimpleSAML_Logger::info('OAuth new_access_token(' . $requestToken . ',' . $consumer . ')');
 		$accestoken = new OAuthToken(SimpleSAML\Utils\Random::generateID(), SimpleSAML\Utils\Random::generateID());
-		// SimpleSAML_Logger::info('OAuth new_access_token(' . $requestToken . ',' . $consumer . ',' . $accestoken . ')');
 		$this->store->set('access', $accestoken->key, $consumer->key, $accestoken, $this->config->getValue('accessTokenDuration', 60*60*24) );
         return $accestoken;
     }
diff --git a/modules/oauth/lib/Registry.php b/modules/oauth/lib/Registry.php
index 8ae9f9361d964461ee9e25765b459a0c367a4765..b8eb7faf25a9c98edeed0ed17e61f433fbb55853 100644
--- a/modules/oauth/lib/Registry.php
+++ b/modules/oauth/lib/Registry.php
@@ -107,17 +107,10 @@ class sspmod_oauth_Registry {
 	}
 
 	public function metaToForm($metadata) {
-		// $this->flattenLanguageField($metadata, 'name');
-		// $this->flattenLanguageField($metadata, 'description');
-		
-		return '<form action="registry.edit.php" method="post">' .		
+		return '<form action="registry.edit.php" method="post">' .
 			'<div id="tabdiv">' .
 			'<ul>' .
-			'<li><a href="#basic">Name and descrition</a></li>' . 
-			// '<li><a href="#saml">SAML 2.0</a></li>' . 
-			// '<li><a href="#attributes">Attributes</a></li>' . 
-			// '<li><a href="#orgs">Organizations</a></li>' . 
-			// '<li><a href="#contacts">Contacts</a></li>' . 
+			'<li><a href="#basic">Name and descrition</a></li>' .
 			'</ul>' .
 			'<div id="basic"><table class="formtable">' .
 				$this->standardField($metadata, 'name', 'Name of client') .
@@ -127,17 +120,9 @@ class sspmod_oauth_Registry {
 				$this->readonlyField($metadata, 'secret', 'Consumer Secret<br/>(Used for HMAC_SHA1 signatures)') .
 				$this->standardField($metadata, 'RSAcertificate', 'RSA certificate (PEM)<br/>(Used for RSA_SHA1 signatures)', TRUE) .
 				$this->standardField($metadata, 'callback_url', 'Static/enforcing callback-url') .
-				
-//				$this->hiddenField('field_key', $metadata['key']) .
 				$this->hiddenField('field_secret', $metadata['secret']) .
 
-			'</table></div>' . 
-			// '<div id="saml"><table class="formtable">' .
-			// 	$this->standardField($metadata, 'AssertionConsumerService', 'AssertionConsumerService endpoint') .
-			// 	$this->standardField($metadata, 'SingleLogoutService', 'SingleLogoutService endpoint') .
-			// 	// $this->standardField($metadata, 'certFingerprint', 'Certificate Fingerprint') .			
-			// 	
-			// '</table></div>' .
+			'</table></div>' .
 			'</div>' .
 			'<input type="submit" name="submit" value="Save" style="margin-top: 5px" />' .
 		'</form>';
diff --git a/modules/oauth/templates/registry.list.php b/modules/oauth/templates/registry.list.php
index 0d11fd6ad571aa7b123101c9149fb6c46e29deed..b1cdbc925ab48ccf1e18cee7138ff9df3c8ceeab 100644
--- a/modules/oauth/templates/registry.list.php
+++ b/modules/oauth/templates/registry.list.php
@@ -2,12 +2,6 @@
 
 $this->data['jquery'] = array('version' => '1.6', 'core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
 $this->data['head']  = '<link rel="stylesheet" type="text/css" href="/' . $this->data['baseurlpath'] . 'module.php/oauth/resources/style.css" />' . "\n";
-// $this->data['head'] .= '<script type="text/javascript">
-// $(document).ready(function() {
-// 	$("#tabdiv").tabs();
-// });
-// </script>';
-
 $this->includeAtTemplateBase('includes/header.php');
 
 
diff --git a/modules/oauth/www/registry.edit.php b/modules/oauth/www/registry.edit.php
index ca5ba80659132dd32969bfb4174c6ce2e78532ce..1ce979ae40f33db5940032184a897f8eadba57fa 100644
--- a/modules/oauth/www/registry.edit.php
+++ b/modules/oauth/www/registry.edit.php
@@ -7,10 +7,8 @@ $oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php');
 
 $store = new sspmod_core_Storage_SQLPermanentStorage('oauth');
 
-//$authsource = $oauthconfig->getValue('auth', 'admin');
 $authsource = "admin";	// force admin to authenticate as registry maintainer
 $useridattr = $oauthconfig->getValue('useridattr', 'user');
-//$useridattr = $oauthconfig->getValue('useridattr', 'uid');
 
 if ($session->isValid($authsource)) {
 	$attributes = $session->getAuthData($authsource, 'Attributes');
@@ -52,9 +50,7 @@ if (isset($_POST['submit'])) {
 	$entry = $editor->formToMeta($_POST, array(), array('owner' => $userid));
 
 	requireOwnership($entry, $userid);
-	
-#	echo('<pre>Created: '); print_r($entry); exit;
-	
+
 	$store->set('consumers', $entry['key'], '', $entry);
 	
 	$template = new SimpleSAML_XHTML_Template($config, 'oauth:registry.saved.php');
diff --git a/modules/oauth/www/registry.php b/modules/oauth/www/registry.php
index 52b06f2e1b7f054c679ef8daeb866737e213b746..dfea92831f8e6fab0a1a0624ea880fe9459ebd36 100644
--- a/modules/oauth/www/registry.php
+++ b/modules/oauth/www/registry.php
@@ -7,10 +7,8 @@ $oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php');
 
 $store = new sspmod_core_Storage_SQLPermanentStorage('oauth');
 
-//$authsource = $oauthconfig->getValue('auth', 'admin');
 $authsource = "admin";	// force admin to authenticate as registry maintainer
 $useridattr = $oauthconfig->getValue('useridattr', 'user');
-//$useridattr = $oauthconfig->getValue('useridattr', 'uid');
 
 if ($session->isValid($authsource)) {
 	$attributes = $session->getAuthData($authsource, 'Attributes');
@@ -52,8 +50,6 @@ foreach($list AS $listitem) {
 	$slist['others'][] = $listitem;
 }
 
-// echo('<pre>'); print_r($slist); exit;
-
 $template = new SimpleSAML_XHTML_Template($config, 'oauth:registry.list.php');
 $template->data['entries'] = $slist;
 $template->data['userid'] = $userid;
diff --git a/modules/portal/hooks/hook_htmlinject.php b/modules/portal/hooks/hook_htmlinject.php
index 83f0f2575a9b16aec5094d1a2f88cc0df08b1460..fb68a3ae3937f03f82498c08d8e0069ad43a5b20 100644
--- a/modules/portal/hooks/hook_htmlinject.php
+++ b/modules/portal/hooks/hook_htmlinject.php
@@ -14,8 +14,6 @@ function portal_hook_htmlinject(&$hookinfo) {
 	$links = array('links' => array());
 	SimpleSAML_Module::callHooks('frontpage', $links);
 
-#	echo('<pre>');	print_r($links); exit;
-
 	$portalConfig = SimpleSAML_Configuration::getOptionalConfig('module_portal.php');
 	
 	$allLinks = array();
@@ -31,8 +29,6 @@ function portal_hook_htmlinject(&$hookinfo) {
 	
 	if (!$portal->isPortalized($hookinfo['page'])) return;
 
-	#print_r($portal->getMenu($hookinfo['page'])); exit;
-
 	// Include jquery UI CSS files in header.
 	$hookinfo['jquery']['css'] = TRUE;
 	$hookinfo['jquery']['version'] = '1.6';
diff --git a/modules/portal/lib/Portal.php b/modules/portal/lib/Portal.php
index 5177421e64b9a3083354ec7b8333ddd31d9baad0..7478e0fde30d4b311425be2777e01319e2792dd3 100644
--- a/modules/portal/lib/Portal.php
+++ b/modules/portal/lib/Portal.php
@@ -37,28 +37,15 @@ class sspmod_portal_Portal {
 	}
 	
 	function getMenu($thispage) {
-	
 		$config = SimpleSAML_Configuration::getInstance();
 		$t = new SimpleSAML_XHTML_Template($config, 'sanitycheck:check-tpl.php');
-		
 		$tabset = $this->getTabset($thispage);
-		
-		#echo($thispage);
-		#echo('<pre>'); print_r($this->pages); exit;
-		
 		$logininfo = $this->getLoginInfo($t, $thispage);
-		#echo $logininfo; exit;
-		
 		$text = '';
-		
-		
 		$text .= '<ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
 		foreach($this->pages AS $pageid => $page) {
 			
 			if (isset($tabset) && !in_array($pageid, $tabset, TRUE)) continue;
-			
-			#echo('This page [' . $pageid . '] is part of [' . join(',', $tabset) . ']');
-			
 			$name = 'uknown';
 			if (isset($page['text'])) $name = $page['text'];
 			if (isset($page['shorttext'])) $name = $page['shorttext'];
diff --git a/modules/radius/lib/Auth/Source/Radius.php b/modules/radius/lib/Auth/Source/Radius.php
index 1bd8a50ddbd45eb6ef462744434ec65a0b77f54f..383369231e3320dc2a08101c72939e66d28244d4 100644
--- a/modules/radius/lib/Auth/Source/Radius.php
+++ b/modules/radius/lib/Auth/Source/Radius.php
@@ -161,7 +161,7 @@ class sspmod_radius_Auth_Source_Radius extends sspmod_core_Auth_UserPassBase {
 
 		if ($this->vendor === NULL) {
 			/*
-			 * We aren't interrested in any vendor-specific attributes. We are
+			 * We aren't interested in any vendor-specific attributes. We are
 			 * therefore done now.
 			 */
 			return $attributes;
@@ -193,11 +193,6 @@ class sspmod_radius_Auth_Source_Radius extends sspmod_core_Auth_UserPassBase {
 			$attrv = $resv['attr'];
 			$datav = $resv['data'];
 
-			/*
-			 * Uncomment this to debug vendor attributes.
-			 */
-			//printf("Got Vendor Attr:%d %d Bytes %s<br/>", $attrv, strlen($datav), bin2hex($datav));
-
 			if ($vendor != $this->vendor || $attrv != $this->vendorType) {
 				continue;
 			}
diff --git a/modules/saml2debug/www/debug.php b/modules/saml2debug/www/debug.php
index 644e600cf814a04057ba249e8d898cf1fd0bad58..4f839252f6f2753b0128dd95244a0393f492212b 100644
--- a/modules/saml2debug/www/debug.php
+++ b/modules/saml2debug/www/debug.php
@@ -13,8 +13,6 @@ function getValue($raw) {
 	$arr = array();
 	$query = parse_str($val, $arr);
 
-	#echo('<pre>');print_r($arr);
-	
 	if (array_key_exists('SAMLResponse', $arr)) return $arr['SAMLResponse'];
 	if (array_key_exists('SAMLRequest', $arr)) return $arr['SAMLRequest'];
 	if (array_key_exists('LogoutRequest', $arr)) return $arr['LogoutRequest'];
@@ -25,8 +23,7 @@ function getValue($raw) {
 
 function decode($raw) {
 	$message = getValue($raw);
-	#echo 'using value: ' . $message; exit;
-	
+
 	$base64decoded = base64_decode($message);
 	$gzinflated = gzinflate($base64decoded);
 	if ($gzinflated != FALSE) {
diff --git a/modules/statistics/lib/Aggregator.php b/modules/statistics/lib/Aggregator.php
index f87772dd87e7fcdae36248aa222a3904ad12326f..0a566eb8c2ebad5b8527ff1bf7b3064b1d9677f3 100644
--- a/modules/statistics/lib/Aggregator.php
+++ b/modules/statistics/lib/Aggregator.php
@@ -145,8 +145,7 @@ class sspmod_statistics_Aggregator {
 				if ($type !== 'aggregate') continue;
 				
 				foreach($this->timeres AS $tres => $tresconfig ) {
-			
-					// echo 'Comparing action: [' . $rule['action'] . '] with [' . $action . ']' . "\n";
+
 					$dh = 'default';
 					if (isset($tresconfig['customDateHandler'])) $dh = $tresconfig['customDateHandler'];
 			
@@ -154,8 +153,7 @@ class sspmod_statistics_Aggregator {
 					$fileslot = $datehandler[$dh]->toSlot($epoch, $tresconfig['fileslot']); //print_r($content);
 				
 					if (isset($rule['action']) && ($action !== $rule['action'])) continue;
-		
-					#$difcol = trim($content[$rule['col']]); // echo '[...' . $difcol . '...]';
+
 					$difcol = self::getDifCol($content, $rule['col']);
 		
 					if (!isset($results[$rulename][$tres][$fileslot][$timeslot]['_'])) $results[$rulename][$tres][$fileslot][$timeslot]['_'] = 0;
@@ -207,9 +205,7 @@ class sspmod_statistics_Aggregator {
 	
 	
 	public function store($results) {
-	
-		// print_r($results); // exit;
-	
+
 		$datehandler = array(
 			'default' => new sspmod_statistics_DateHandler($this->offset),
 			'month' => new  sspmod_statistics_DateHandlerMonth($this->offset),
@@ -217,11 +213,7 @@ class sspmod_statistics_Aggregator {
 	
 		// Iterate the first level of results, which is per rule, as defined in the config.
 		foreach ($results AS $rulename => $timeresdata) {
-		
-			// $timeresl = array_keys($timeresdata);
-			// 
-			// print_r($timeresl); exit;
-			
+
 			// Iterate over time resolutions
 			foreach($timeresdata AS $tres => $resres) {
 
@@ -249,38 +241,28 @@ class sspmod_statistics_Aggregator {
 					$end = (int)$datehandler['default']->toSlot(
 							$datehandler[$dh]->fromSlot($fileno+1, $this->timeres[$tres]['fileslot']), 
 							$this->timeres[$tres]['slot']);
-					
-					// echo('from slot ' . $start . ' to slot ' . $end . ' maxslot ' . $maxslot . "\n");
-					// print_r($slotlist);
-					// 			exit;
-					
+
 					// Fill in missing entries and sort file results
 					$filledresult = array();
 					for ($slot = $start; $slot < $end; $slot++) {
 						if (array_key_exists($slot,  $fileres)) {
 							$filledresult[$slot] = $fileres[$slot];
 						} else {
-							#echo('SLot [' . $slot . '] of [' . $maxslot . ']' . "\n");
 							if ($lastfile == $fileno && $slot > $maxslot) {
 								$filledresult[$slot] = array('_' => NULL);
 							} else {
 								$filledresult[$slot] = array('_' => 0);
-							}				
+							}
 						}
-						# print_r($filledresult[$slot]);
-						#  = (isset($fileres[$slot])) ? $fileres[$slot] : array('_' => NULL);
 					}
-					// print_r($filledresult); exit;
 					
 					$filename = $this->statdir . '/' . $rulename . '-' . $tres . '-' . $fileno . '.stat';
 					if (file_exists($filename)) {
-						// echo('Reading existing file: ' . $filename . "\n");
 						$previousData = unserialize(file_get_contents($filename));
 						$filledresult = $this->cummulateData($previousData, $filledresult);	
 					}
 				
 					// store file
-					# echo('Writing to file: ' . $filename . "\n");
 					file_put_contents($filename, serialize($filledresult), LOCK_EX);
 				}
 				
diff --git a/modules/statistics/lib/DateHandler.php b/modules/statistics/lib/DateHandler.php
index 63ecacb83ec66c31df6c68ced9ac88133fec1763..271d5a7739dfd5b20cfe99de83ad370c04744bd7 100644
--- a/modules/statistics/lib/DateHandler.php
+++ b/modules/statistics/lib/DateHandler.php
@@ -5,7 +5,7 @@
  */
 class sspmod_statistics_DateHandler {
 
-	private $offset;
+	protected $offset;
 
 	/**
 	 * Constructor
@@ -27,8 +27,6 @@ class sspmod_statistics_DateHandler {
 	}
 
 	public function fromSlot($slot, $slotsize) {
-		// echo("slot $slot slotsize $slotsize offset  " . $this->offset);
-		// throw new Exception();
 		$temp = $slot*$slotsize - $this->offset;
 		$dst = $this->getDST($temp);
 		return $slot*$slotsize - $this->offset - $dst;
@@ -49,16 +47,4 @@ class sspmod_statistics_DateHandler {
 		$text .= $this->prettyDateSlot($to, $slotsize, $dateformat);
 		return $text;
 	}
-
 }
-
-// 	$datestr = substr($logline,0,$datenumbers);
-// 	#$datestr = substr($logline,0,23);
-// 	$timestamp = parse15($datestr) + $offset;
-// 	$restofline = substr($logline,$datenumbers+1);
-// 	$restcols = split(' ', $restofline);
-// 	$action = $restcols[5];
-	
-// 	print_r($timestamp);
-// 	print_r($restcols); if ($i++ > 5) exit;
-
diff --git a/modules/statistics/lib/DateHandlerMonth.php b/modules/statistics/lib/DateHandlerMonth.php
index 5520a6a5348fff204bd759bb7cfa865543e63a4d..c7f0fae65b7aab7825ecf9549dfa221a00c1312c 100644
--- a/modules/statistics/lib/DateHandlerMonth.php
+++ b/modules/statistics/lib/DateHandlerMonth.php
@@ -5,8 +5,6 @@
  */
 class sspmod_statistics_DateHandlerMonth extends sspmod_statistics_DateHandler {
 
-
-
 	/**
 	 * Constructor
 	 *
@@ -19,10 +17,8 @@ class sspmod_statistics_DateHandlerMonth extends sspmod_statistics_DateHandler {
 
 	public function toSlot($epoch, $slotsize) {
 		$dsttime = $this->getDST($epoch) + $epoch;
-		$parsed = getdate($dsttime);		
-		// print_r($parsed);
+		$parsed = getdate($dsttime);
 		$slot = (($parsed['year'] - 2000) * 12) + $parsed['mon'] - 1;
-		// echo('converting ' . $epoch . ' to ' . $slot ); exit;
 		return $slot;
 	}
 
@@ -32,7 +28,6 @@ class sspmod_statistics_DateHandlerMonth extends sspmod_statistics_DateHandler {
 		$year = 2000 + floor($slot / 12);
 		
 		$epoch = mktime(0, 0, 0, $month + 1, 1, $year, FALSE);
-		// echo('epoch ' . $epoch . ' from slot '. $slot . " year " . $year . " month " . $month . "\n");
 		return $epoch;
 	}
 
@@ -43,17 +38,4 @@ class sspmod_statistics_DateHandlerMonth extends sspmod_statistics_DateHandler {
 		
 		return $year . '-' . $month;
 	}
-
-
 }
-
-// 	$datestr = substr($logline,0,$datenumbers);
-// 	#$datestr = substr($logline,0,23);
-// 	$timestamp = parse15($datestr) + $offset;
-// 	$restofline = substr($logline,$datenumbers+1);
-// 	$restcols = split(' ', $restofline);
-// 	$action = $restcols[5];
-	
-// 	print_r($timestamp);
-// 	print_r($restcols); if ($i++ > 5) exit;
-
diff --git a/modules/statistics/lib/Graph/GoogleCharts.php b/modules/statistics/lib/Graph/GoogleCharts.php
index 385068ef8c3e9ebe581274a0d04ed01890ed1f51..cf1564c5dd9f053147a9f5a560388e5865874c29 100644
--- a/modules/statistics/lib/Graph/GoogleCharts.php
+++ b/modules/statistics/lib/Graph/GoogleCharts.php
@@ -46,13 +46,11 @@ class sspmod_statistics_Graph_GoogleCharts {
 			if($v >= 0 && $v <= 100){ 
 				$first = substr($extended_table, intval( ($delta*$v/100) / $size),1);
 				$second = substr($extended_table, intval( ($delta*$v/100) % $size), 1);
-				$chardata .= "$first$second"; 
-				#echo '<p>encoding ' . $v . ' to ' . $first . ' ' . $second . '';
+				$chardata .= "$first$second";
 			} else { 
 				$chardata .= '__'; // Value out of max range; 
 			} 
-		} 
-		#echo ' encoding ' . join(' ', $values) . ' to ' . $chardata; exit;
+		}
 		return($chardata); 
 	}
 	
@@ -105,7 +103,6 @@ class sspmod_statistics_Graph_GoogleCharts {
 			'&chd=' . $this->encodedata($datasets) .
 			
 			// Fill area...
-#			$this->getFillArea($datasets) . 
 			'&chco=ff5c00,cca600' . 
 			'&chls=1,1,0|1,6,3' .
 			
@@ -113,9 +110,7 @@ class sspmod_statistics_Graph_GoogleCharts {
 			'&cht=lc' .
 			$labeld .
 			'&chxl=0:|' . $this->encodeaxis($axis) . # . $'|1:||top' .
-			'&chxp=0,' . join(',', $axispos) . 
-#			'&chxp=0,0.3,0.4' .
-#			'&chm=R,CCCCCC,0,0.25,0.5' .
+			'&chxp=0,' . join(',', $axispos) .
 			'&chg=' . (2400/(count($datasets[0])-1)) . ',-1,3,3';   // lines
 		return $url;
 	}
diff --git a/modules/statistics/lib/LogCleaner.php b/modules/statistics/lib/LogCleaner.php
index 2cb496211f6a19072049b97af62fd20828ed84cd..652dc670bf3b7dc76c0a3cc344bcb51b9a3ab77b 100644
--- a/modules/statistics/lib/LogCleaner.php
+++ b/modules/statistics/lib/LogCleaner.php
@@ -46,9 +46,7 @@ class sspmod_statistics_LogCleaner {
 		
 		
 		$file = fopen($this->inputfile, 'r');
-		#$logfile = file($this->inputfile, FILE_IGNORE_NEW_LINES );
-		
-		
+
 		$logparser = new sspmod_statistics_LogParser(
 			$this->statconfig->getValue('datestart', 0), $this->statconfig->getValue('datelength', 15), $this->statconfig->getValue('offsetspan', 44)
 		);
@@ -78,7 +76,6 @@ class sspmod_statistics_LogCleaner {
 			}
 			
 			$trackid = $content[4];
-			#echo "trackid: " . $content[4] . "\n";
 			
 			if(!isset($sessioncounter[$trackid])) $sessioncounter[$trackid] = 0;
 			$sessioncounter[$trackid]++;
@@ -105,8 +102,7 @@ class sspmod_statistics_LogCleaner {
 		foreach($sessioncounter AS $trackid => $sc) {
 			if($sc > 200) $todelete[] = $trackid;
 		}
-		
-		#print_r($histogram);
+
 		return $todelete;
 	}
 	
@@ -122,8 +118,7 @@ class sspmod_statistics_LogCleaner {
 			throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']');
 		
 		$file = fopen($this->inputfile, 'r');
-		#$logfile = file($this->inputfile, FILE_IGNORE_NEW_LINES );
-		
+
 		/* Open the output file in a way that guarantees that we will not overwrite a random file. */
 		if (file_exists($outputfile)) {
 			/* Delete existing output file. */
@@ -157,10 +152,7 @@ class sspmod_statistics_LogCleaner {
 			$trackid = $content[4];
 			
 			if (in_array($trackid, $todelete)) {
-				#echo "Deleting entry with trackid: $trackid \n";
 				continue;
-			} else {
-				#echo "NOT Deleting entry with trackid: $trackid \n";
 			}
 			
 			fputs($outfile, $logline);
diff --git a/modules/statistics/lib/LogParser.php b/modules/statistics/lib/LogParser.php
index d0d54ca076ef156a47039173c9b61f57bee6d8ef..bde18db3711820337b877d39ffbe955ac9b4190f 100644
--- a/modules/statistics/lib/LogParser.php
+++ b/modules/statistics/lib/LogParser.php
@@ -38,9 +38,6 @@ class sspmod_statistics_LogParser {
 			$year = gmdate('Y', $epoch) - 1;
 			$epoch = gmmktime($hour, $minute, $second, $month, $day, $year);
 		}
-
-// 		echo 'debug   ' . $line . "\n";
-// 		echo 'debug   [' . substr($line, 0, $this->datelength)  . '] => [' . $epoch . ']' . "\n";
 		return $epoch;
 	}
 
diff --git a/modules/statistics/lib/RatioDataset.php b/modules/statistics/lib/RatioDataset.php
index 9c1314c0db9479861feae2a6ea750507e1e23afd..653fc88610c9bb1961742d8c80324c20efb12db0 100644
--- a/modules/statistics/lib/RatioDataset.php
+++ b/modules/statistics/lib/RatioDataset.php
@@ -34,7 +34,6 @@ class sspmod_statistics_RatioDataset extends sspmod_statistics_StatDataset {
 		
 		asort($this->summary);
 		$this->summary = array_reverse($this->summary, TRUE);
-		// echo '<pre>'; print_r($summaryDataset); exit;
 	}
 	
 	private function ag($k, $a) {
@@ -49,7 +48,6 @@ class sspmod_statistics_RatioDataset extends sspmod_statistics_StatDataset {
 	
 	public function combine($result1, $result2) {
 
-		
 		$combined = array();
 		
 		foreach($result2 AS $tick => $val) {
@@ -62,17 +60,6 @@ class sspmod_statistics_RatioDataset extends sspmod_statistics_StatDataset {
 			}
 			
 		}
-		
-		// echo('<pre>');
-		// echo('combine 1 ');
-		// print_r($result1);
-		// echo('combine 2 ');
-		// print_r($result2); 
-		// echo('combineed ');
-		// print_r($combined); 
-		// 
-		// exit;
-		
 		return $combined;
 	}
 	
diff --git a/modules/statistics/lib/Ruleset.php b/modules/statistics/lib/Ruleset.php
index f23724972020714a46dcdffe79669d6464683eae..0af00ddf1951c1ec4dfa78409211f8af6b401e23 100644
--- a/modules/statistics/lib/Ruleset.php
+++ b/modules/statistics/lib/Ruleset.php
@@ -51,7 +51,6 @@ class sspmod_statistics_Ruleset {
 		foreach ($this->availrules AS $key) {
 			$available_rules[$key] = array('name' => $statrules[$key]['name'], 'descr' => $statrules[$key]['descr']);
 		}
-		// echo('<pre>'); print_r($available_rules); exit;
 		$this->availrulenames = $available_rules;
 		
 	}
diff --git a/modules/statistics/lib/StatDataset.php b/modules/statistics/lib/StatDataset.php
index 916c502ab0a2e7886b763c8624ede9cc432509af..1116ca17b24a5af579b241a743155d9907f29a0f 100644
--- a/modules/statistics/lib/StatDataset.php
+++ b/modules/statistics/lib/StatDataset.php
@@ -65,7 +65,6 @@ class sspmod_statistics_StatDataset {
 	public function setDelimiter($delimiter = '_') {
 		if (empty($delimiter)) $delimiter = '_';
 		$this->delimiter = $delimiter;
-		// echo 'delimiter set to ' . $delimiter; exit;
 	}
 	public function getDelimiter() {
 		if ($this->delimiter === '_') return NULL;
@@ -79,8 +78,7 @@ class sspmod_statistics_StatDataset {
 		 */
 		$slotsize = $this->ruleconfig->getValue('slot');
 		$dateformat_period = $this->timeresconfig->getValue('dateformat-period');
-		$dateformat_intra =  $this->timeresconfig->getValue('dateformat-intra'); 
-		// $axislabelint =  $this->ruleconfig->getValue('axislabelint');
+		$dateformat_intra =  $this->timeresconfig->getValue('dateformat-intra');
 
 		
 		$maxvalue = 0; $maxvaluetime = NULL;
@@ -96,12 +94,11 @@ class sspmod_statistics_StatDataset {
 	
 	public function getDebugData() {
 		$debugdata = array();
-		
+
 		$slotsize = $this->timeresconfig->getValue('slot');
 		$dateformat_period = $this->timeresconfig->getValue('dateformat-period');
-		$dateformat_intra =  $this->timeresconfig->getValue('dateformat-intra'); 
-		// $axislabelint =  $this->ruleconfig->getValue('axislabelint');
-		
+		$dateformat_intra =  $this->timeresconfig->getValue('dateformat-intra');
+
 		foreach($this->results AS $slot => &$res) {
 			$debugdata[$slot] = array($this->datehandlerTick->prettyDateSlot($slot, $slotsize, $dateformat_intra), $res[$this->delimiter] );
 		}
@@ -125,7 +122,6 @@ class sspmod_statistics_StatDataset {
 		}
 		asort($this->summary);
 		$this->summary = array_reverse($this->summary, TRUE);
-		// echo '<pre>'; print_r($summaryDataset); exit;
 	}
 	
 	public function getTopDelimiters() {
@@ -195,8 +191,7 @@ class sspmod_statistics_StatDataset {
 			// check if there should be an axis here...
 			if ( $slot % $axislabelint == 0)  {
 				$axis[] =  $this->datehandlerTick->prettyDateSlot($slot, $slotsize, $dateformat_intra);
-				$axispos[] = (($i)/($xentries-1));		
-				// echo 'set axis on [' . $slot . '] = [' . $datehandler->prettyDateSlot($slot, $slotsize, $dateformat_intra) . ']';
+				$axispos[] = (($i)/($xentries-1));
 			}
 			$lastslot = $slot;
 			$i++;
@@ -226,10 +221,6 @@ class sspmod_statistics_StatDataset {
 
 		$dataset = array();
 		foreach($this->results AS $slot => $res) {
-			#echo ('<p>new value: ' . number_format(100*$res[$delimiter] / $max, 2));
-	// 		echo('<hr><p>delimiter [<tt>' .$delimiter . '</tt>].');
-	// 		echo('<p>Res <pre>'); print_r($res); echo( '</pre>');
-	// 		echo('<p>return <pre>'); print_r(isset($res[$delimiter]) ? $res[$delimiter] : 'NO'); echo('</pre>');
 			if (array_key_exists($this->delimiter, $res)) {
 				if ($res[$this->delimiter] === NULL) {
 					$dataset[] = -1;
@@ -239,8 +230,6 @@ class sspmod_statistics_StatDataset {
 			} else {
 				$dataset[] = '0';
 			}
-			// foreach(array_keys($res) AS $nd) $availdelimiters[$nd] = 1;
-			
 			$lastslot = $slot;
 			$i++;
 		}
diff --git a/modules/statistics/lib/Statistics/Rulesets/BaseRule.php b/modules/statistics/lib/Statistics/Rulesets/BaseRule.php
index 6c2068fef34930d45f0f3e5b353e192ae77e09db..65099c8c03bca6f6bfcbdabe75ea3ec7b3429531 100644
--- a/modules/statistics/lib/Statistics/Rulesets/BaseRule.php
+++ b/modules/statistics/lib/Statistics/Rulesets/BaseRule.php
@@ -39,7 +39,6 @@ class sspmod_statistics_Statistics_Rulesets_BaseRule {
 			if (array_key_exists($tres, $this->available))
 				$available_times[$tres] = $tresconfig['name'];
 		}
-		// echo('<pre>'); print_r($available_times); exit;
 		return $available_times;
 	}
 
diff --git a/modules/statistics/templates/statistics-tpl.php b/modules/statistics/templates/statistics-tpl.php
index 6fe94a4de66a8483f51cfecd216b77002ace152a..73f5e5ff8f8f3cc68cc265cdd6c55619ea1adcb1 100644
--- a/modules/statistics/templates/statistics-tpl.php
+++ b/modules/statistics/templates/statistics-tpl.php
@@ -3,8 +3,6 @@ $this->data['header'] = 'SimpleSAMLphp Statistics';
 
 $this->data['jquery'] = array('version' => '1.6', 'core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
 
-// $this->data['hideLanguageBar'] = TRUE;
-
 $this->data['head'] ='';
 $this->data['head'] .= '<script type="text/javascript">
 $(document).ready(function() {
@@ -92,11 +90,6 @@ td.datacontent {
 echo('<h1>'. $this->data['available.rules'][$this->data['selected.rule']]['name'] . '</h1>');
 echo('<p>' . $this->data['available.rules'][$this->data['selected.rule']]['descr'] . '</p>');
 
-// echo('<pre>');
-// print_r($this->data);
-// exit;
-
-
 // Report settings
 echo '<table class="selecttime" style="width: 100%; border: 1px solid #ccc; background: #eee; margin: 1px 0px; padding: 0px">';
 echo('<tr><td style="width: 50px; padding: 0px"><img style="margin: 0px" src="../../resources/icons/crystal_project/kchart.32x32.png" alt="Report settings" /></td>');
@@ -119,9 +112,6 @@ echo '</td>';
 
 // Select delimiter
 echo '<td style="text-align: right">';
-
-#echo('<pre>here'); print_r($this->data['delimiterPresentation']); echo('</pre>');
-
 echo '<form style="display: inline">';
 echo getBaseURL($this, 'post', 'd');
 echo '<select onChange="submit();" name="d">';
@@ -168,7 +158,6 @@ if (isset($this->data['available.times.prev'])) {
 echo '<td style="text-align: right">';
 echo '<form style="display: inline">';
 echo getBaseURL($this, 'post', 'res');
-// echo '<input type="hidden" name="rule" value="' . $this->data['selected.rule'] . '" />';
 echo '<select onChange="submit();" name="res">';
 foreach ($this->data['available.timeres'] AS $key => $timeresname) {
 	if ($key == $this->data['selected.timeres']) {
@@ -184,7 +173,6 @@ echo '</td>';
 echo '<td style="text-align: left">';
 echo '<form style="display: inline">';
 echo getBaseURL($this, 'post', 'time');
-// echo '<input type="hidden" name="rule" value="' . $this->data['selected.rule'] . '" />';
 echo '<select onChange="submit();" name="time">';
 foreach ($this->data['available.times'] AS $key => $timedescr) {
 	if ($key == $this->data['selected.time']) {
@@ -272,18 +260,7 @@ foreach ( $this->data['summaryDataset'] as $key => $value ) {
 echo '</table></div>';
 //  - - - - - - - End table view - - - - - - - 
 
-
-// 
-//  echo('<pre>');
-// print_r($this->data['results']);
-// exit;
-
-
 echo '<div id="debug" >';
-
-#echo $this->data['selected.time'];
-#echo '<input style="width: 80%" value="' . htmlspecialchars($this->data['imgurl']) . '" />';
-
 echo '<table class="timeseries" style="">';
 echo('<tr><th>Time</th><th>Total</th>');
 foreach($this->data['topdelimiters'] AS $key) {
diff --git a/modules/statistics/www/showstats.php b/modules/statistics/www/showstats.php
index 0af0e9d6742baed964f2c78ad34c23436f3f46f4..ed4c443fc31801934f073ba2c5d9759319b9ef17 100644
--- a/modules/statistics/www/showstats.php
+++ b/modules/statistics/www/showstats.php
@@ -62,7 +62,6 @@ $maxes[] = $dataset->getMax();
 
 if (isset($preferRule2)) {
 	$statrule = $ruleset->getRule($preferRule2);
-#	$rule2 = $statrule->getRuleID();
 	$dataset2 = $statrule->getDataset($preferTimeRes, $preferTime);
 	$dataset2->aggregateSummary();
 	$dataset2->calculateMax();