Fix event handling in kernel calls.