Patch 1

A couple of small changes that will make the script work better for international users. I don't know about other cases, but in my server, at least 50% of the files have accents either in the filename or the filepath, so it is very important that the script can handle those files correctly.