Some tweaks to scripts and debug messages