Fixed issue with file overwrites.