fixed a few errors in kernel for real this time