Added AI and other fixes