Fix some issues with the script.