Fix cascade deletion of related objects