Fixed a bug in the CPU version. It is still present in the OpenCL
version.