Fix logic for determining if a name is already registered.