Fixed bugs with AI