fixes #2109 By adding logic so that the default file type for writing is the same as the file instead of always SIF when other files types (such as .xml) are used.