Fixed problems with AI