Fixed duplication mediation again

Changed it so we flag the registeredWithContext before we search for children and find ourselves.