Improve AI to eliminate invalid moves.