Added callbacks around the kernel.