Debug.php, login.php and others improvements