Fixed some incorrect code generation.