Fixed errors in AI scripts.