fixed references in resolver.remove

and extra tests to make sure listener calling doesn't blow up