Fixed AI, now properly wanders and switches states when necessary.