Fixed script errors