More cleanup in code spawning a new kernel.