Fixed error when generating nodes from raw tree