Another attempt at fixing replace_server.

Signed-off-by: Daira Hopwood <daira@leastauthority.com>