Fixed bugs in AIClient