Optimizations on leader election.