[Bug 18664] Merging an application with itself causes all child objects to be deleted