Fix problem for when dir() returns Str