Fixed error in KernelWrapper