Fixed indexing bug in extractGhostKernel