Simplfied CGroup switching code a bit.