4.0.x branch fixes for IIS/Windows