do not try to clear relationship when there is no inverse

should fix #976