get TestMisc working, generated code is not beautiful, but correctness is the first goal