Fixes several issues, including a restart bug and compilation on kernel 4.9. Signed-off-by: Rosen Penev <rosenp@gmail.com>