Autoupdate for leader election and minor fix