Fixing some problems with d3d build.