Some fixes to the scripts