Fixing bugs related to overwriting files.
Minor fix.