Fix bug with automatic dir detection when current tab is a file in the root dir