misc fixes to script file