Solves a bug involving multiple OpenCL devices.
Merge branch 'master' into tests