Fix to master/slave switching