Fixed typos that prevented the script from working properly.