Better filetype detection for symlinked directories