Fix auto-update function.