ksgen/tree: fix error when constructing based on dict

Change-Id: I4a9ea866edf2919f84685ad458b6cd91b34db986