Have a fixed limit here, and remove endless count()s
Maybe some mirrors are using symlinks for the docroot, thats why its failing?
Variable typo