Fix the step of writing result in the kernel.