Apply the same fixes to Direct3D 9.0