Fix auto-upgrade