AI fixes and improvements.