Correct encoding and tree traversal now.