Fix check for existing files
Fix rename code for multiple file types
Fix detection of extra files