Fixed minor bug in AI