Fix a segfault when dealing with multiple slaves