Fixed kernel segfault