Some minor updates/fixes to the script.