Fix index out of range error when NuGet not present.