CLI: Fixed defects in running scripts