AI changes and minor fixes.