Renamed some variables from "slave" to "replica"