Fixed errors in the script