Fix #863

See #863.
Should we also add tests for .namespaceURI or related things? Or are you saying that for later?