bugfixes for opposite refs removal & things like that