Fix bug in file renaming routine
Merge pull request #3 from javierbertoli/master

Fix bug in file renaming routine