Fix issue with events and non Element/Document nodes
Merge pull request #176 from arv/event-on-non-element-document-nodes

Fix issue with events and non Element/Document nodes