Error fixing and debug improvement.
Fix an error in the sed command file creation.
Add debug option to not delete the sed file at the end of the process.