Fix incorrect leader appointer state check that broke some tests.