Fixed bugs with adding the time stamp to the end of file names