Corrected the bad array informations, now get the name printed, and corrected in the URL.
Added a little protection for bad files that are empty.