Fixed minor code generation issues