Added cg precontion ifdefs to ch, and fixed some problems with ppcg