D3D fixes