Fix FxCop issues
Fixed build errors
Merge pull request #2046 from NuGet/danliu/testfix

Fix the run test scripts.