minor fixes master-replica
added old (1.5) version of replica.cc