Made replication peer selection logic more efficient.
Minor change.