Minor fixes to the kernel