Added stalemate check.