fixes around deletion of relations