Fix bug in multi-datacenter replication keyspace build and add test