Fixed an ai bug.