Fixes to scripts