Fix "too many directories" error