Added support for multiple kernels.