Fixed some parts of the script.