update codeGen tests
fix some bugs

in some case function overrides other functions. bug fixed