Correctly build path before calling isDir()