Jit fixes

- Fixed issues with casting in CUDA and OpenCL backends.