Fix remote dirname testing