Fix bug with directories that are > 1000