Fix invalid code generation.