Fixed case where path has no parent in Path.GetDirectoryName