Fixed a bug in the minimax