Compensate for -URLByDeletingLastPathComponent not handling double slashes properly