Bug fixes to Codegen for exps