delete oPath.NewMinimal cos it sucks and there is no need for it. It was causing a bug with oPath.Equals on account of it wasnt correctly determining whether a path found with s:GetSelectedPath() was a dir or a file.