(360) Add more error checking in D3D code