improved dependency cleanup in ManifestUtils