Minor fixes in MainScript