BUG: Fixed issues with atan2 in CUDA and OpenCL backends

- This should fix issue #236