Fixes #391. Checks for existing file and if exists appends duplicate num...

...ber to new file.