Cleaning the kernel

Cleaning several points listed in the TODO list of the developers.