Better handling of DOM properties

Fixes #1974, #1975
Merge pull request #2008 from wagenet/prop-handling

Better handling of DOM properties