Index: applications/editors/josm/plugins/seachart/src/s57/S57enc.java
===================================================================
--- applications/editors/josm/plugins/seachart/src/s57/S57enc.java	(revision 31736)
+++ applications/editors/josm/plugins/seachart/src/s57/S57enc.java	(revision 31737)
@@ -255,5 +255,5 @@
 				ArrayList<ArrayList<Fparams>> objects = new ArrayList<ArrayList<Fparams>>();
 				ArrayList<Long> slaves = new ArrayList<Long>();
-				long slaveid = feature.id & 0x01ffffffffffffffl;
+				long slaveid = feature.id + 0x0100000000000000l;
 				for (Entry<Obj, ObjTab> objs : feature.objs.entrySet()) {
 					Obj objobj = objs.getKey();
@@ -267,5 +267,10 @@
 						Object[] attf = new Object[0];
 						Object[] natf = new Object[0];
-						for (Entry<Att, AttVal<?>> att : object.getValue().entrySet()) {
+						AttMap atts = map.new AttMap();
+						atts.putAll(object.getValue());
+						if (master) {
+							atts.putAll(feature.atts);
+						}
+						for (Entry<Att, AttVal<?>> att : atts.entrySet()) {
 							if (!((obj == Obj.SOUNDG) && (att.getKey() == Att.VALSOU))) {
 								long attl = S57att.encodeAttribute(att.getKey());
Index: applications/editors/josm/plugins/seachart/src/s57/S57map.java
===================================================================
--- applications/editors/josm/plugins/seachart/src/s57/S57map.java	(revision 31736)
+++ applications/editors/josm/plugins/seachart/src/s57/S57map.java	(revision 31737)
@@ -40,4 +40,5 @@
 		ISOL,	// Node not part of Edge
 		CONN,	// Edge first and last nodes
+		TRNK, // Edge truncated polygon nodes
 		DPTH	// Sounding nodes
 	}
Index: applications/editors/josm/plugins/seachart/src/s57/S57osm.java
===================================================================
--- applications/editors/josm/plugins/seachart/src/s57/S57osm.java	(revision 31736)
+++ applications/editors/josm/plugins/seachart/src/s57/S57osm.java	(revision 31737)
@@ -18,5 +18,11 @@
 import s57.S57val.*;
 
-public class S57osm { // OSM to S57 Object/Attribute conversions
+public class S57osm { // OSM to S57 Object/Attribute and Object/Primitive conversions
+	
+	enum Prims { P, L, A, PA, PL, LA, PLA }
+	private static final EnumMap<Obj, Prims> S57prims = new EnumMap<Obj, Prims>(Obj.class);
+	static {
+		S57prims.put(Obj.UNKOBJ, Prims.PLA);
+	}
 
 	static class KeyVal<V> {
