Fixed AI triple equals bug. Added loop perf gain.