Fixes to the script