Fix win detection