Updating to correctly delete empty chains.