diff --git a/html/progress.php b/html/progress.php
index f8e908c629e7488afd33630b4e262fc97ac3c8f6..c133b48b49912f3efe9514cf39cc1e6750ebbcf6 100644
--- a/html/progress.php
+++ b/html/progress.php
@@ -75,8 +75,10 @@ if (!function_exists("imagecreate")) {
   }
 
   /* Draw image in GD image stream */
-  $im = imagecreate ($x, $y)
-    or die ("Cannot Initialize new GD image stream");
+  $im = imagecreate ($x, $y);
+  if (!$im) {
+    die ('Cannot Initialize new GD image stream');
+  }
 
   /* Set colors */
   $bg_color = imagecolorallocate($im, 255,  255,  255);
diff --git a/include/class_xml.inc b/include/class_xml.inc
index e00f0cc51992ff0044b927083132f5dfa128f300..5b2549c04f211c27d867e2b8e2c5309b7740fc44 100644
--- a/include/class_xml.inc
+++ b/include/class_xml.inc
@@ -1,5 +1,4 @@
 <?php
-
 /*
   This code is part of FusionDirectory (http://www.fusiondirectory.org/)
   Copyright (C) 2003-2010  Cajus Pollmeier
@@ -30,48 +29,6 @@
  * files
  */
 class xml {
-
-  /*!
-   * \brief Validate a xml file from a schema
-   *
-   * \param string $file XML Filename
-   *
-   * \param string $schema Schema of the XML file
-   */
-  static function validate($file, $schema)
-  {
-    // Enable user error handling
-    libxml_use_internal_errors(TRUE);
-
-    $xml = new DOMDocument();
-    $xml->load($file);
-
-    if (!$xml->schemaValidate($schema)) {
-      $errors = libxml_get_errors();
-      foreach ($errors as $error) {
-        $str = "";
-        switch ($error->level) {
-          case LIBXML_ERR_WARNING:
-            $str = _("Warning")." ".$error->code.": ";
-            break;
-          case LIBXML_ERR_ERROR:
-            $str = _("Error")." ".$error->code.": ";
-            break;
-          case LIBXML_ERR_FATAL:
-            $str = _("Fatal error")." ".$error->code.": ";
-            break;
-        }
-        $str .= trim($error->message);
-        if ($error->file) {
-            $str .= " "._("in")." ".$error->file;
-        }
-        $str .= " "._("on line")." ".$error->line;
-        msg_dialog::display(_("XML error"), $str, ERROR_DIALOG);
-      }
-      libxml_clear_errors();
-    }
-  }
-
   /*!
    * \brief Transform a xml document to an array
    *
diff --git a/include/functions_debug.inc b/include/functions_debug.inc
index 7963190f5d5dedef042cdb5e1099680a10c63bbc..9c577a1394a8f29211ca626b3d6ecb98f5ed6a15 100644
--- a/include/functions_debug.inc
+++ b/include/functions_debug.inc
@@ -112,7 +112,9 @@ class Print_a_class {
    */
   function print_a($array, $iteration = FALSE, $key_bg_color = FALSE)
   {
-    $key_bg_color or $key_bg_color = $this->key_bg_color;
+    if (!$key_bg_color) {
+      $key_bg_color = $this->key_bg_color;
+    }
 
     if (!$iteration && isset($this->export_flag)) {
       $this->output .= '<form id="pa_form_'.$this->export_hash.'" action="'.$this->export_dumper_path.'?mode='.$this->export_flag.'" method="post" target="_blank"><input name="array" type="hidden" value="'.htmlspecialchars( serialize( $array ) ).'"></form>';
@@ -123,8 +125,13 @@ class Print_a_class {
       for ($i = 0; $i < 6; $i += 2) {
         $c = substr( $key_bg_color, $i, 2 );
         $c = hexdec( $c );
-        ( $c += 15 ) > 255 and $c = 255;
-        isset($tmp_key_bg_color) or $tmp_key_bg_color = '';
+        $c += 15;
+        if ($c > 255) {
+          $c = 255;
+        }
+        if (!isset($tmp_key_bg_color)) {
+          $tmp_key_bg_color = '';
+        }
         $tmp_key_bg_color .= sprintf( "%02X", $c );
       }
       $key_bg_color = $tmp_key_bg_color;
@@ -221,7 +228,7 @@ class Print_a_class {
 function print_a($array, $return_mode = FALSE, $show_object_vars = FALSE, $export_flag = FALSE )
 {
   $e = error_reporting(0);
-  if (is_array($array) or is_object($array)) {
+  if (is_array($array) || is_object($array)) {
     $pa = new Print_a_class;
     if ($show_object_vars) {
       $pa->show_object_vars = TRUE;
diff --git a/setup/class_setup.inc b/setup/class_setup.inc
index a0593e5a7a81ca07d68cabf7c2d033f5457b2cb3..ebc380a3941d699e812f5dcde51f181fadd0ba75 100644
--- a/setup/class_setup.inc
+++ b/setup/class_setup.inc
@@ -40,9 +40,15 @@ class fake_userinfo extends userinfo
 
 class setup
 {
-  var $i_steps;               // Number of setup steps
-  var $i_current        = 0;  // Current step
-  var $i_previous       = 0;  // Previous setup step;
+  /* Number of setup steps */
+  var $i_steps;
+
+  /* Current step */
+  var $i_current        = 0;
+
+  /* Previous setup step */
+  var $i_previous       = 0;
+
   var $i_config         = 4;
   var $o_steps          = array();
   var $captured_values  = array();
diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc
index 04f6b6db0b24421a23ca121959d55b7bc107cc04..08182b0e9fe3d3a94830f27ff02ec5d003110b21 100644
--- a/setup/class_setupStep.inc
+++ b/setup/class_setupStep.inc
@@ -104,13 +104,11 @@ class setupStep extends simplePlugin
   /* bypass LDAP loading */
   protected function loadAttributes()
   {
-    foreach ($this->attributesInfo as &$sectionInfo) {
-      foreach ($sectionInfo['attrs'] as $name => &$attr) {
+    foreach ($this->attributesInfo as $sectionInfo) {
+      foreach ($sectionInfo['attrs'] as $attr) {
         $attr->setParent($this);
       }
-      unset($attr);
     }
-    unset($sectionInfo);
   }
 }
 ?>
diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc
index c875bc42aaa9f934fe4c0c0f2ab9be23607f5482..d192c2b8601e8bc7ddad535e6d96ca00e743067f 100644
--- a/setup/class_setupStep_Migrate.inc
+++ b/setup/class_setupStep_Migrate.inc
@@ -352,7 +352,8 @@ class Step_Migrate extends setupStep
       /* Try to detect base class type, e.g. is it a dcObject */
       $dep_types  = departmentManagement::getDepartmentTypes();
       $dep_type   = "";
-      $attrs['objectClass'][] = 'gosaDepartment'; // This allow us to filter it as if it was already migrated
+      /* This allow us to filter it as if it was already migrated */
+      $attrs['objectClass'][] = 'gosaDepartment';
       foreach ($dep_types as $type) {
         if (objects::isOfType($attrs, $type)) {
           $dep_type = $type;