Fixing recursive dependency resolution for REMOVE command