Adding events and tidying up kernel.