Fix renaming.
Add debug mode to name generation - will append more information to file names.