Modify the FindPrimary implementation so that it works correctly with a configuration