Fix msbuild target bugs