Fixed undefined vars in adds_scenario.php
Refactoring