Debugging slightly working AI for Tic-Tac-Toe