Added option to overwrite file even if it exists.