diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php
index 9f77505c0f84ae9f9bf00a9b411a99924b809e61..0cc8950733403a4808208c6a8f64a3cd3bb50157 100644
--- a/modules/consent/lib/Auth/Process/Consent.php
+++ b/modules/consent/lib/Auth/Process/Consent.php
@@ -75,7 +75,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             if (!is_bool($config['includeValues'])) {
                 throw new SimpleSAML_Error_Exception(
                     'Consent: includeValues must be boolean. ' .
-                    var_export($config['includeValues']) . ' given.'
+                    var_export($config['includeValues'], true) . ' given.'
                 );
             }
             $this->_includeValues = $config['includeValues'];
@@ -85,7 +85,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             if (!is_bool($config['checked'])) {
                 throw new SimpleSAML_Error_Exception(
                     'Consent: checked must be boolean. ' .
-                    var_export($config['checked']) . ' given.'
+                    var_export($config['checked'], true) . ' given.'
                 );
             }
             $this->_checked = $config['checked'];
@@ -95,7 +95,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             if (!in_array($config['focus'], array('yes', 'no'), true)) {
                 throw new SimpleSAML_Error_Exception(
                     'Consent: focus must be a string with values `yes` or `no`. ' .
-                    var_export($config['focus']) . ' given.'
+                    var_export($config['focus'], true) . ' given.'
                 );
             }
             $this->_focus = $config['focus'];
@@ -105,7 +105,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             if (!is_array($config['hiddenAttributes'])) {
                 throw new SimpleSAML_Error_Exception(
                     'Consent: hiddenAttributes must be an array. ' .
-                    var_export($config['hiddenAttributes']) . ' given.'
+                    var_export($config['hiddenAttributes'], true) . ' given.'
                 );
             }
             $this->_hiddenAttributes = $config['hiddenAttributes'];
@@ -115,7 +115,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             if (!is_array($config['noconsentattributes'])) {
                 throw new SimpleSAML_Error_Exception(
                     'Consent: noconsentattributes must be an array. ' .
-                    var_export($config['noconsentattributes']) . ' given.'
+                    var_export($config['noconsentattributes'], true) . ' given.'
                 );
             }
             $this->_noconsentattributes = $config['noconsentattributes'];
diff --git a/modules/core/lib/ACL.php b/modules/core/lib/ACL.php
index 65860ad1703d93d5dc07de6ef9b2e6ec7d4ec700..724f18435d28a4ebb59690470f3163241607be19 100644
--- a/modules/core/lib/ACL.php
+++ b/modules/core/lib/ACL.php
@@ -119,7 +119,7 @@ class sspmod_core_ACL {
 		case 'or':
 			return self::opOr($attributes, $rule);
 		default:
-			throw new SimpleSAML_Error_Exception('Invalid ACL operation: ' . var_export($op. TRUE));
+			throw new SimpleSAML_Error_Exception('Invalid ACL operation: ' . var_export($op, TRUE));
 		}
 	}
 
diff --git a/modules/core/templates/show_metadata.tpl.php b/modules/core/templates/show_metadata.tpl.php
index 6f6782f664c96f7616ecb290639a316ccb2777c3..ff55e9c28ecd70934407f550255001684e1494b1 100644
--- a/modules/core/templates/show_metadata.tpl.php
+++ b/modules/core/templates/show_metadata.tpl.php
@@ -7,7 +7,7 @@ $this->includeAtTemplateBase('includes/header.php');
 
 echo('<pre style="font-size: 110%">');
 
-echo(htmlspecialchars(var_export($this->data['m'])));
+echo(htmlspecialchars(var_export($this->data['m'], true)));
 
 echo('</pre>');
 
diff --git a/modules/oauth/www/accessToken.php b/modules/oauth/www/accessToken.php
index af09b11a93f4e8a195b7642685d05816a3179366..82eed1756f1e60e4861189a6c9ad9f375e6f12d3 100644
--- a/modules/oauth/www/accessToken.php
+++ b/modules/oauth/www/accessToken.php
@@ -35,7 +35,4 @@ try {
 	
 	header('Content-type: text/plain; utf-8', TRUE, 500);
 	header('OAuth-Error: ' . $e->getMessage());
-
-	print_r($e);
-	
 }
diff --git a/modules/oauth/www/authorize.php b/modules/oauth/www/authorize.php
index 25fe1941a34ec3b494b72b777861a3a59003f653..afcc395b9a1722fb6d65795967307f7b1e4b459e 100644
--- a/modules/oauth/www/authorize.php
+++ b/modules/oauth/www/authorize.php
@@ -79,13 +79,4 @@ try {
 	
 	header('Content-type: text/plain; utf-8', TRUE, 500);
 	header('OAuth-Error: ' . $e->getMessage());
-
-	print_r($e);
-	
 }
-
-
-// 
-// $req = OAuthRequest::from_request();
-// $token = $server->fetch_request_token($req);
-// echo $token;
diff --git a/modules/oauth/www/requestToken.php b/modules/oauth/www/requestToken.php
index df861754a3209714fc279a6b4558268dcd504223..3e270701cf743957f8f290e31bd71ffcf995e3f2 100644
--- a/modules/oauth/www/requestToken.php
+++ b/modules/oauth/www/requestToken.php
@@ -26,7 +26,4 @@ try {
 	
 	header('Content-type: text/plain; utf-8', TRUE, 500);
 	header('OAuth-Error: ' . $e->getMessage());
-
-	print_r($e);
-	
 }
diff --git a/modules/statistics/lib/Aggregator.php b/modules/statistics/lib/Aggregator.php
index f588ca67f24cdd990f0e054c35d5da40dfc7e148..f87772dd87e7fcdae36248aa222a3904ad12326f 100644
--- a/modules/statistics/lib/Aggregator.php
+++ b/modules/statistics/lib/Aggregator.php
@@ -122,7 +122,7 @@ class sspmod_statistics_Aggregator {
 				echo("----------------------------------------\n");
 				echo('Log line: ' . $logline . "\n");
 				echo('Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) . '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n");
-				print_r($content);
+				echo htmlentities(print_r($content, true));
 				if ($i >= 13) exit;
 			}
 			
diff --git a/modules/statistics/lib/LogCleaner.php b/modules/statistics/lib/LogCleaner.php
index 55c7493e54abbf648b1af284b0fc33e790ae9061..2cb496211f6a19072049b97af62fd20828ed84cd 100644
--- a/modules/statistics/lib/LogCleaner.php
+++ b/modules/statistics/lib/LogCleaner.php
@@ -88,7 +88,7 @@ class sspmod_statistics_LogCleaner {
 				echo("----------------------------------------\n");
 				echo('Log line: ' . $logline . "\n");
 				echo('Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) . '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n");
-				print_r($content);
+				echo htmlentities(print_r($content, true));
 				if ($i >= 13) exit;
 			}