Fixes for D3D9