Fix exit codes in code generator