fixes to script