Fix registry logic.