Check a datastore for additional resources before deleting.  Fixes #1510.