diff --git a/lib/API.php b/lib/API.php
index 3966dfc96552e62b7cb40d6e4c0e83fa9141750b..aeeb509904d81cdbc613c10e1887ad0887475517 100644
--- a/lib/API.php
+++ b/lib/API.php
@@ -101,7 +101,7 @@ class API {
         foreach ($supportedOptions as $opt) {
             $this->assignOpt($opt);
         }
-//        print_r($this->opts);
+        Utils::debug(5, $this->opts, "OPTS: ", "\n");
     }
 
     private function optionError($optName) {
@@ -300,15 +300,18 @@ class API {
                 if ($optValue != 1 && $optValue != 2) {
                     $optValue = 0;
                 }
+                break;
             case 'details':
                 if ($optValue != 1) {
                     $optValue = 0;
                 }
+                break;
             case 'valid_sec':
                 $optValue = filter_var($optValue, FILTER_SANITIZE_NUMBER_INT);
                 if ($optValue == '') {
                     $optValue = 0;
                 }
+                break;
             default:
         }
         $this->opts[$optName] = $optValue;
@@ -608,7 +611,6 @@ class API {
         if ($this->opts['help'] == 1) {
             return "";
         }
-        Utils::debug(5, $this->opts, "OPTS: ", "\n");
         $edugain = new eduGAIN(5, $this->fed_id, true);
         $edugain->load_federations_state();
         if ($this->opts['only_errors'] > 0) {