Minor cleanup in kernel.c