diff --git a/tests/p_mailman/mailman_test.sh b/tests/p_mailman/mailman_test.sh
index b1d4156..f51fa0c 100755
--- a/tests/p_mailman/mailman_test.sh
+++ b/tests/p_mailman/mailman_test.sh
@@ -7,9 +7,11 @@ t_Log "Running $0 - mailman test."
 /usr/lib/mailman/bin/newlist -q mailman root@localhost.localdomain password > /dev/null 2>&1
 
 # Restart httpd (started in other tests) and start mailman 
-service httpd restart
-service mailman start
+t_ServiceControl httpd restart
+t_ServiceControl mailman start
 
 curl -s http://localhost/mailman/listinfo | grep -q 'localhost Mailing Lists'
-
 t_CheckExitStatus $?
+
+t_ServiceControl httpd stop
+t_ServiceControl mailman stop
diff --git a/tests/p_mod_wsgi/mod_wsgi_test.sh b/tests/p_mod_wsgi/mod_wsgi_test.sh
index adb64bc..95a0aee 100755
--- a/tests/p_mod_wsgi/mod_wsgi_test.sh
+++ b/tests/p_mod_wsgi/mod_wsgi_test.sh
@@ -1,12 +1,13 @@
 #!/bin/sh
-# Author: Athmane Madjoudj <athmanem@gmail.com>
 
 t_Log "Running $0 - Apache httpd mod_wsgi is functional"
-if (t_GetPkgRel basesystem | grep -q el6)
-then
+if (t_GetPkgRel basesystem | grep -q el6); then
+	while [ `ps fax | grep 'sbin/httpd' | grep -v grep  | wc -l` -gt 0 ]; do
+	  t_ServiceControl httpd stop
+	  sleep 1
+	done
 
-
-cat > /etc/httpd/conf.d/tf_app.conf <<EOF
+	cat > /etc/httpd/conf.d/tf_app.conf <<EOF
 WSGIScriptAlias /tfapp /var/www/html/tf_app.wsgi
 EOF
 
@@ -23,16 +24,11 @@ def application(environ, start_response):
     return [output]
 EOF
 
-while [ `ps fax | grep 'sbin/httpd' | grep -v grep  | wc -l` -gt 0 ]; do
-  t_ServiceControl httpd stop
-  sleep 1
-done
-t_ServiceControl httpd start
-
-curl -s http://localhost/tfapp | grep -q 't_functional_mod_wsgi_test'
-
-t_CheckExitStatus $?
+	t_ServiceControl httpd start
+	curl -s http://localhost/tfapp | grep -q 't_functional_mod_wsgi_test'
+	t_CheckExitStatus $?
+	t_ServiceControl  httpd stop
 
 else 
     echo "Skipped on CentOS 5"
-fi
+fi
\ No newline at end of file