Minor fixes in leader election and log replication