Several patches for D3DX