Fix incorrect error reporting when a file path basedir is empty