Fixed the ScenarioWriter and the tests