Fix bug in AppKernel