Improve CUDA tests by fixing some errors, and making the tests actually fail if a CUDA error occurred.