small fixes to script