Fix kernel mode error.

I needa work this out.