Fixed minor bugs in code generation.