Prevented trimming of the root's children
Fixed several bugs with accidental usage of freed nodes
Merge branch 'origin/develop'