Bug fixes in AI