Fix bug in destroyNodesInTree

Using manual loop instead of for-in-pairs in destroyNodesInTree.
Previously was buggy (nodes might not be removed) as table.remove inside
for loop is unsafe. Also added support for VirtualResolution so scaling
node isn't removed.