Remove empty nodes from dependents / dependencies.