fixed nullref bug when thing to patch was at last line of file
added nuget package restore