Fixed error in cli.php and cleaned up if statement