Fix saving with auto-added extension (fix #268)