Adjusted kernel_matrix function and SparseKernelModel class to work with create_kern function.