Some AI bugs fixed.