Fixed strange bug involving kernel code overwrite