Changed unsigned int index values in kernels to size_t to comply with API documentation.