Fixing a few things in kernel.c