Fixed a bug in the CUDA kernel.