Index: src/uk/me/parabola/imgfmt/FileSystemParam.java
===================================================================
--- src/uk/me/parabola/imgfmt/FileSystemParam.java	(revision 3753)
+++ src/uk/me/parabola/imgfmt/FileSystemParam.java	(working copy)
@@ -12,6 +12,8 @@
  */
 package uk.me.parabola.imgfmt;
 
+import java.util.regex.Pattern;
+
 /**
  * Small class to hold all kinds of filesystem parameters. If a field
  * is not set then it is not used.
@@ -26,7 +28,8 @@
 	private int reservedDirectoryBlocks = 202;
 	private boolean gmapsupp;
 	private boolean hideGmapsuppOnPC;
-
+	short mapVersion;
+	
 	public String getFilename() {
 		return filename;
 	}
@@ -84,4 +87,12 @@
 	public void setHideGmapsuppOnPC(boolean hideGmapsuppOnPC) {
 		this.hideGmapsuppOnPC = hideGmapsuppOnPC;
 	}
+
+	public short getMapVersion() {
+		return mapVersion;
+	}
+
+	public void setMapVersion(short mapVersion) {
+		this.mapVersion = mapVersion; 
+	}
 }
Index: src/uk/me/parabola/imgfmt/sys/ImgHeader.java
===================================================================
--- src/uk/me/parabola/imgfmt/sys/ImgHeader.java	(revision 3753)
+++ src/uk/me/parabola/imgfmt/sys/ImgHeader.java	(working copy)
@@ -45,6 +45,7 @@
 
 	// Offsets into the header.
 	private static final int OFF_XOR = 0x0;
+	private static final int OFF_PROD_VERSION= 0x08;
 	private static final int OFF_UPDATE_MONTH = 0xa;
 	private static final int OFF_UPDATE_YEAR = 0xb; // +1900 for val >= 0x63, +2000 for less
 	private static final int OFF_SUPP = 0xe;		// Appears to be set for gmapsupp files
@@ -165,7 +166,10 @@
 		setCreationTime(date);
 		setUpdateTime(date);
 		setDescription(params.getMapDescription());
-		header.put(OFF_SUPP, (byte) (fsParams.isGmapsupp() && fsParams.isHideGmapsuppOnPC() ? 1: 0));
+		if (fsParams.isGmapsupp()) {
+			header.put(OFF_SUPP, (byte) (fsParams.isHideGmapsuppOnPC() ? 1: 0));
+		}
+		header.putShort(OFF_PROD_VERSION, fsParams.getMapVersion());
 
 		// Checksum is not checked.
 		header.put(OFF_CHECKSUM, (byte) 0);
@@ -350,16 +354,6 @@
 	}
 
 	/**
-	 * Convert a string to a byte array.
-	 * @param s The string
-	 * @return A byte array.
-	 */
-	private static byte[] toByte(String s) {
-		// NB: what character set should be used?
-		return s.getBytes();
-	}
-
-	/**
 	 * Convert to the one byte code that is used for the year.
 	 * If the year is in the 1900, then subtract 1900 and add the result to 0x63,
 	 * else subtract 2000.
@@ -384,10 +378,6 @@
 		this.numBlocks = numBlocks;
 	}
 
-	public void hideGmapsuppOnPC (boolean b) {
-		header.put(OFF_SUPP, (byte) (fsParams.isGmapsupp() && b ? 1: 0));
-	}
-	
 	/**
 	 * Represent a block number in the chs format.
 	 *
Index: src/uk/me/parabola/mkgmap/CommandArgs.java
===================================================================
--- src/uk/me/parabola/mkgmap/CommandArgs.java	(revision 3753)
+++ src/uk/me/parabola/mkgmap/CommandArgs.java	(working copy)
@@ -1,6 +1,8 @@
 package uk.me.parabola.mkgmap;
 
 import java.io.File;
+import java.util.HashSet;
+import java.util.regex.Pattern;
 
 import uk.me.parabola.imgfmt.app.srt.Sort;
 import uk.me.parabola.util.EnhancedProperties;
@@ -11,6 +13,7 @@
 
 	private final EnhancedProperties currentOptions;
 	private Sort sort;
+	private final HashSet<String> badMapVersions = new HashSet<>();
 
 	public CommandArgs(EnhancedProperties args) {
 		currentOptions = new EnhancedProperties(args);
@@ -50,6 +53,34 @@
 		return currentOptions.getProperty("mapname");
 	}
 
+	public short getMapVersion () {
+		Short mapVersion = null;
+		String mapVersionString = currentOptions.getProperty("map-version", "0.0");
+		String[] versions = mapVersionString.split(Pattern.quote("."));
+		try {
+			if (versions.length == 2) {
+				int major = Integer.valueOf(versions[0]);
+				int minor = Integer.valueOf(versions[1]);
+				if (major >= 0 && major < 256 && minor >= 0 && minor < 256)
+					mapVersion = (short) ((minor << 8) | major);
+
+			} else if (versions.length == 1) {
+				int v = Integer.valueOf(mapVersionString);
+				if (v >= 0 && v < 256)
+					mapVersion = (short) v;
+			}
+		} catch (NumberFormatException e) {
+		}
+		if (mapVersion == null) {
+			if (!badMapVersions.contains(mapVersionString)) {
+				System.err.println("invalid option map-version=" + mapVersionString + " is ignored.");
+				badMapVersions.add(mapVersionString);
+			}
+			mapVersion = 0;
+		}
+		return mapVersion;
+	}
+	
 	public String getCharset() {
 
 		String charset = currentOptions.getProperty("charset");
Index: src/uk/me/parabola/mkgmap/CommandArgsReader.java
===================================================================
--- src/uk/me/parabola/mkgmap/CommandArgsReader.java	(revision 3753)
+++ src/uk/me/parabola/mkgmap/CommandArgsReader.java	(working copy)
@@ -274,8 +274,8 @@
 			// Increase the name number.  If the next arg sets it then that
 			// will override this new name.
 			mapname = args.getProperty("mapname");
-			try {
-				Formatter fmt = new Formatter();
+			
+			try (Formatter fmt = new Formatter()){
 				try {
 					int n = Integer.parseInt(mapname);
 					fmt.format("%08d", ++n);
@@ -283,7 +283,6 @@
 					fmt.format("%8.8s", mapname);
 				}
 				args.setProperty("mapname", fmt.toString());
-				fmt.close();
 			} catch (NumberFormatException e) {
 				// If the name is not a number then we just leave it alone...
 			}
Index: src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java	(revision 3753)
+++ src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java	(working copy)
@@ -85,6 +85,7 @@
 	private final Map<Integer, Sort> sortMap = new LinkedHashMap<>();
 	private boolean splitName;
 	private boolean hideGmapsuppOnPC;
+	private short mapVersion;
 
 
 	public void init(CommandArgs args) {
@@ -94,6 +95,7 @@
 		outputDir = args.getOutputDir();
 		splitName = args.get("split-name-index", false);
 		hideGmapsuppOnPC = args.get("hide-gmapsupp-on-pc", false);
+		mapVersion = args.getMapVersion();
 	}
 
 	/**
@@ -242,7 +244,7 @@
 		return mb;
 	}
 
-	private ProductBlock makeProductBlock(FileInfo info) {
+	private static ProductBlock makeProductBlock(FileInfo info) {
 		ProductBlock pb = new ProductBlock(info.getCodePage());
 		pb.setFamilyId(info.getFamilyId());
 		pb.setProductId(info.getProductId());
@@ -307,7 +309,7 @@
 		mpsFile.addProduct(makeProductBlock(info));
 	}
 
-	private MpsFile createMpsFile(FileSystem outfs) throws FileNotWritableException {
+	private static MpsFile createMpsFile(FileSystem outfs) throws FileNotWritableException {
 		try {
 			ImgChannel channel = outfs.create("MAKEGMAP.MPS");
 			return new MpsFile(channel);
@@ -324,12 +326,12 @@
 	 * @param outfs The output gmapsupp file.
 	 * @param filename The input filename.
 	 */
-	private void addFile(FileSystem outfs, String filename) {
+	private static void addFile(FileSystem outfs, String filename) {
 		String imgname = createImgFilename(filename);
 		addFile(outfs, filename, imgname);
 	}
 
-	private void addFile(FileSystem outfs, String filename, String imgname) {
+	private static void addFile(FileSystem outfs, String filename, String imgname) {
 		ImgChannel chan = new FileImgChannel(filename, "r");
 		try {
 			copyFile(chan, outfs, imgname);
@@ -350,7 +352,7 @@
 	 * @return The filename part, will be restricted to 8+3 characters and all
 	 * in upper case.
 	 */
-	private String createImgFilename(String pathname) {
+	private static String createImgFilename(String pathname) {
 		File f = new File(pathname);
 		String name = f.getName().toUpperCase(Locale.ENGLISH);
 		int dot = name.lastIndexOf('.');
@@ -372,7 +374,7 @@
 	 * @param outfs The gmapsupp file to write to.
 	 * @param filename The input filename.
 	 */
-	private void addImg(FileSystem outfs, String filename) {
+	private static void addImg(FileSystem outfs, String filename) {
 		try {
 			try (FileSystem infs = ImgFS.openFs(filename)) {
 				copyAllFiles(infs, outfs);
@@ -389,7 +391,7 @@
 	 * @param infs The input filesystem.
 	 * @param outfs The output filesystem.
 	 */
-	private void copyAllFiles(FileSystem infs, FileSystem outfs) {
+	private static void copyAllFiles(FileSystem infs, FileSystem outfs) {
 		List<DirectoryEntry> entries = infs.list();
 		for (DirectoryEntry ent : entries) {
 			String ext = ent.getExt();
@@ -423,6 +425,7 @@
 		params.setDirectoryStartEntry(DIRECTORY_OFFSET_ENTRY);
 		params.setGmapsupp(true);
 		params.setHideGmapsuppOnPC(hideGmapsuppOnPC);
+		params.setMapVersion(mapVersion);
 
 		int reserveBlocks = (int) Math.ceil(bi.reserveEntries * 512.0 / blockSize);
 		params.setReservedDirectoryBlocks(reserveBlocks);
@@ -444,7 +447,7 @@
 	 * @param outfs The filesystem to copy to.
 	 * @throws IOException If the copy fails.
 	 */
-	private void copyFile(String inName, FileSystem infs, FileSystem outfs) throws IOException {
+	private static void copyFile(String inName, FileSystem infs, FileSystem outfs) throws IOException {
 		ImgChannel fin = infs.open(inName, "r");
 		copyFile(fin, outfs, inName);
 	}
@@ -456,7 +459,7 @@
 	 * @param inName The name of the file to create on the destination file system.
 	 * @throws IOException If a file cannot be read or written.
 	 */
-	private void copyFile(ImgChannel fin, FileSystem outfs, String inName) throws IOException {
+	private static void copyFile(ImgChannel fin, FileSystem outfs, String inName) throws IOException {
 		ImgChannel fout = outfs.create(inName);
 
 		copyFile(fin, fout);
@@ -470,7 +473,7 @@
 	 * @param fout The file to copy to.
 	 * @throws IOException If the copy fails.
 	 */
-	private void copyFile(ImgChannel fin, ImgChannel fout) throws IOException {
+	private static void copyFile(ImgChannel fin, ImgChannel fout) throws IOException {
 		try {
 			ByteBuffer buf = ByteBuffer.allocate(1024);
 			while (fin.read(buf) > 0) {
Index: src/uk/me/parabola/mkgmap/combiners/OverviewBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/OverviewBuilder.java	(revision 3753)
+++ src/uk/me/parabola/mkgmap/combiners/OverviewBuilder.java	(working copy)
@@ -61,6 +61,7 @@
 	private List<String[]> copyrightMsgs = new ArrayList<String[]>();
 	private List<String[]> licenseInfos = new ArrayList<String[]>();
 	private LevelInfo[] wantedLevels;
+	private short mapVersion;
 
 
 	public OverviewBuilder(OverviewMap overviewSource) {
@@ -72,6 +73,7 @@
 		overviewMapname = args.get("overview-mapname", "osmmap");
 		overviewMapnumber = args.get("overview-mapnumber", "63240000");
 		outputDir = args.getOutputDir();
+		mapVersion = args.getMapVersion();
 	}
 
 	public void onMapEnd(FileInfo finfo) {
@@ -167,6 +169,7 @@
 		FileSystemParam params = new FileSystemParam();
 		params.setBlockSize(512);
 		params.setMapDescription(areaName);
+		params.setMapVersion(mapVersion);
 		mb.setCopyrights(creMsgList(copyrightMsgs));
 		mb.setMapInfo(creMsgList(licenseInfos));
 		
Index: src/uk/me/parabola/mkgmap/main/MapMaker.java
===================================================================
--- src/uk/me/parabola/mkgmap/main/MapMaker.java	(revision 3753)
+++ src/uk/me/parabola/mkgmap/main/MapMaker.java	(working copy)
@@ -93,6 +93,7 @@
 		FileSystemParam params = new FileSystemParam();
 		params.setBlockSize(args.getBlockSize());
 		params.setMapDescription(args.getDescription());
+		params.setMapVersion(args.getMapVersion());
 		log.info("Started making", args.getMapname(), "(" + args.getDescription() + ")");
 		try {
 			Map map = Map.createMap(mapNamePrefix + args.getMapname(), args.getOutputDir(), params, args.getMapname(), sort);
@@ -124,7 +125,7 @@
 	 * @param map The map to modify.
 	 * @param args The command line arguments.
 	 */
-	private void setOptions(Map map, CommandArgs args) {
+	private static void setOptions(Map map, CommandArgs args) {
 		map.config(args.getProperties());
 
 		String s = args.getCharset();
@@ -145,7 +146,7 @@
 	 * @throws FileNotFoundException For non existing files.
 	 * @throws FormatException When the file format is not valid.
 	 */
-	private LoadableMapDataSource loadFromFile(CommandArgs args, String name) throws
+	private static LoadableMapDataSource loadFromFile(CommandArgs args, String name) throws
 			FileNotFoundException, FormatException
 	{
 		LoadableMapDataSource src = MapReader.createMapReader(name);
