Fix issue with deleted relationships