Fix issue with events and non Element/Document nodes