Fixed most of CUDA problems brought about by kernel changes