Various AI & Core bugs fixed.