Fix error with no children when adding node