Fixes #368

Avoids the false positives listed in #368 and passes all tests.
`var entities = isObject ? node.properties : node.elements;`