Minor fixes to script