Fix bad master detection logic.