Make sure a valid ShadowRoot or Document is returned from target.owner

Fixes #115