fix mistakes in dumpKstr and add a testcase