Fix bug in kernel module