Continued to refactor Ai.
Fixed bugs.