Fix the last remaining problems with the existing clients and make the kernel code for MRG more OpenCL-friendly.