Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java	(revision 32582)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java	(revision 32585)
@@ -12,5 +12,4 @@
 import org.openstreetmap.josm.plugins.pt_assistant.actions.AddStopPositionAction;
 import org.openstreetmap.josm.plugins.pt_assistant.validation.PTAssistantValidatorTest;
-import org.openstreetmap.josm.tools.ImageProvider;
 
 /**
@@ -52,19 +51,4 @@
 		}
 	}
-	
-	/**
-	 * Returns a ImageProvider for the given string or null if in headless mode.
-	 *
-	 * @param s
-	 *            The name of the file where the picture is.
-	 * @return A ImageProvider object for the given string or null if in
-	 *         headless mode.
-	 */
-	public static ImageProvider getProvider(String s) {
-		if (Main.main == null) {
-			return null;
-		}
-		return new ImageProvider(s);
-	}
 
 }
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/AddStopPositionAction.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/AddStopPositionAction.java	(revision 32582)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/AddStopPositionAction.java	(revision 32585)
@@ -9,5 +9,7 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JoinNodeWayAction;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.actions.SplitWayAction;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Node;
@@ -44,8 +46,11 @@
 			return;
 		}
+		
+		final ActionEvent actionEventParameter = e;
 
 		Main.map.mapView.addMouseListener(new MouseAdapter() {
 
 			LatLon clickPosition;
+
 
 			@Override
@@ -65,4 +70,12 @@
 						osmDataLayer.data.setSelected(newNode);
 						Main.map.mapView.repaint();
+						
+						// make the stop position node part of the way:
+						JoinNodeWayAction joinNodeWayAction = JoinNodeWayAction.createJoinNodeToWayAction();
+						joinNodeWayAction.actionPerformed(actionEventParameter);
+						
+						// split the way:
+						SplitWayAction splitWayAction = new SplitWayAction();
+						splitWayAction.actionPerformed(actionEventParameter);
 
 					}
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java	(revision 32582)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java	(revision 32585)
@@ -24,12 +24,19 @@
 		super(other);
 
-		if ((other.hasRole("stop") || other.hasRole("stop_entry_only") || other.hasRole("stop_exit_only"))
-				&& other.getType().equals(OsmPrimitiveType.NODE)) {
+		// if ((other.hasRole("stop") || other.hasRole("stop_entry_only") ||
+		// other.hasRole("stop_exit_only"))
+		// && other.getType().equals(OsmPrimitiveType.NODE)) {
+
+		if (other.getMember().hasTag("public_transport", "stop_position")) {
 
 			this.stopPosition = other.getNode();
 			this.name = stopPosition.get("name");
 
-		} else if (other.getRole().equals("platform") || other.getRole().equals("platform_entry_only")
-				|| other.getRole().equals("platform_exit_only")) {
+			// } else if (other.getRole().equals("platform") ||
+			// other.getRole().equals("platform_entry_only")
+			// || other.getRole().equals("platform_exit_only")) {
+		} else if (other.getMember().hasTag("highway", "bus_stop")
+				|| other.getMember().hasTag("public_transport", "platform")
+				|| other.getMember().hasTag("highway", "platform") || other.getMember().hasTag("railway", "platform")) {
 
 			this.platform = other.getMember();
@@ -37,5 +44,6 @@
 
 		} else {
-			throw new IllegalArgumentException("The RelationMember type does not match its role " + other.getMember().getName());
+			throw new IllegalArgumentException(
+					"The RelationMember type does not match its role " + other.getMember().getName());
 		}
 
@@ -57,5 +65,7 @@
 
 		// add stop position:
-		if (member.hasRole("stop") || member.hasRole("stop_entry_only") || member.hasRole("stop_exit_only")) {
+		// if (member.hasRole("stop") || member.hasRole("stop_entry_only") ||
+		// member.hasRole("stop_exit_only")) {
+		if (member.getMember().hasTag("public_transport", "stop_position")) {
 			if (member.getType().equals(OsmPrimitiveType.NODE) && stopPosition == null) {
 				this.stopPosition = member.getNode();
@@ -65,6 +75,10 @@
 
 		// add platform:
-		if (member.getRole().equals("platform") || member.getRole().equals("platform_entry_only")
-				|| member.getRole().equals("platform_exit_only")) {
+		// if (member.getRole().equals("platform") ||
+		// member.getRole().equals("platform_entry_only")
+		// || member.getRole().equals("platform_exit_only")) {
+		if (member.getMember().hasTag("highway", "bus_stop")
+				|| member.getMember().hasTag("public_transport", "platform")
+				|| member.getMember().hasTag("highway", "platform") || member.getMember().hasTag("railway", "platform")) {
 			if (platform == null) {
 				platform = member.getMember();
@@ -123,5 +137,6 @@
 		}
 
-		// Look for a stop position within 100 m (around 0.002 degrees) of this platform:
+		// Look for a stop position within 100 m (around 0.002 degrees) of this
+		// platform:
 
 		LatLon platformCenter = platform.getBBox().getCenter();
@@ -139,31 +154,4 @@
 		}
 
-		// // 1) Look for any stop_area relations that this platform
-		// // belongs to:
-		// ArrayList<OsmPrimitive> platformList = new
-		// ArrayList<OsmPrimitive>(1);
-		// platformList.add(platform);
-		// Set<Relation> platformParentRelations =
-		// OsmPrimitive.getParentRelations(platformList);
-		// ArrayList<Relation> stopAreaList = new ArrayList<Relation>();
-		// for (Relation platformParentRelation : platformParentRelations) {
-		// if (platformParentRelation.hasTag("public_transport", "stop_area")) {
-		// stopAreaList.add(platformParentRelation);
-		// }
-		// }
-		//
-		// // 2) Get all potential stop_positions from those stop_area
-		// relations:
-		// for (Relation stopArea : stopAreaList) {
-		// for (RelationMember rm : stopArea.getMembers()) {
-		// if ((rm.hasRole("stop") || rm.hasRole("stop_entry_only") ||
-		// rm.hasRole("stop_exit_only"))&&
-		// rm.getType().equals(OsmPrimitiveType.NODE)
-		// && rm.getNode().hasTag("public_transport", "stop_position")) {
-		// potentialStopPositions.add(rm.getNode());
-		// }
-		// }
-		// }
-
 		return potentialStopPositions;
 	}
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java	(revision 32582)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java	(revision 32585)
@@ -33,9 +33,9 @@
 				|| r.hasTag("route", "tram") || r.hasTag("route", "light_rail") || r.hasTag("route", "subway")
 				|| r.hasTag("route", "train")) {
-			
+
 			if (!r.hasTag("bus", "on_demand")) {
 				return true;
 			}
-			
+
 		}
 		return false;
@@ -52,25 +52,26 @@
 	public static boolean isPTStop(RelationMember rm) {
 
-		if (rm.hasRole("stop") || rm.hasRole("stop_entry_only") || rm.hasRole("stop_exit_only")
-				|| rm.hasRole("platform") || rm.hasRole("platform_entry_only") || rm.hasRole("platform_exit_only")) {
+		// if (rm.hasRole("stop") || rm.hasRole("stop_entry_only") ||
+		// rm.hasRole("stop_exit_only")
+		// || rm.hasRole("platform") || rm.hasRole("platform_entry_only") ||
+		// rm.hasRole("platform_exit_only")) {
 
-			if (rm.getType().equals(OsmPrimitiveType.NODE)) {
+		if (rm.getType().equals(OsmPrimitiveType.NODE)) {
 
-				if (rm.getNode().hasTag("public_transport", "stop_position")
-						|| rm.getNode().hasTag("highway", "bus_stop")
-						|| rm.getNode().hasTag("public_transport", "platform")
-						|| rm.getNode().hasTag("highway", "platform") || rm.getNode().hasTag("railway", "platform")) {
-					return true;
+			if (rm.getNode().hasTag("public_transport", "stop_position") || rm.getNode().hasTag("highway", "bus_stop")
+					|| rm.getNode().hasTag("public_transport", "platform") || rm.getNode().hasTag("highway", "platform")
+					|| rm.getNode().hasTag("railway", "platform")) {
+				return true;
 
-				}
-			}
-
-			if (rm.getType().equals(OsmPrimitiveType.WAY)) {
-				if (rm.getWay().hasTag("public_transport", "platform") || rm.getWay().hasTag("highway", "platform")
-						|| rm.getWay().hasTag("railway", "platform")) {
-					return true;
-				}
 			}
 		}
+
+		if (rm.getType().equals(OsmPrimitiveType.WAY)) {
+			if (rm.getWay().hasTag("public_transport", "platform") || rm.getWay().hasTag("highway", "platform")
+					|| rm.getWay().hasTag("railway", "platform")) {
+				return true;
+			}
+		}
+		// }
 
 		return false;
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/Checker.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/Checker.java	(revision 32582)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/Checker.java	(revision 32585)
@@ -5,10 +5,11 @@
 
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.validation.Test;
 import org.openstreetmap.josm.data.validation.TestError;
-
+import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils;
 
 /**
- * Represents tests and fixed of the PT_Assistant plugin 
+ * Represents tests and fixed of the PT_Assistant plugin
  * 
  * @author darya
@@ -16,5 +17,5 @@
  */
 public abstract class Checker {
-	
+
 	// test which created this WayChecker:
 	protected final Test test;
@@ -25,12 +26,12 @@
 	// stores all found errors:
 	protected ArrayList<TestError> errors = new ArrayList<>();
-	
+
 	protected Checker(Relation relation, Test test) {
-		
+
 		this.relation = relation;
 		this.test = test;
 
 	}
-	
+
 	/**
 	 * Returns errors
@@ -40,7 +41,70 @@
 		return errors;
 	}
-	
-	
-	
+
+	/**
+	 * Returns a list of stop-related route relation members with corrected
+	 * roles (if necessary)
+	 * 
+	 * @return list of stop-related route relation members
+	 */
+	protected static List<RelationMember> listStopMembers(Relation r) {
+
+		List<RelationMember> resultList = new ArrayList<>();
+
+		for (RelationMember rm : r.getMembers()) {
+
+			if (RouteUtils.isPTStop(rm)) {
+
+				if (rm.getMember().hasTag("public_transport", "stop_position")) {
+					if (!rm.hasRole("stop") && !rm.hasRole("stop_entry_only") && !rm.hasRole("stop_exit_only")) {
+						RelationMember newMember = new RelationMember("stop", rm.getMember());
+						resultList.add(newMember);
+					} else {
+						resultList.add(rm);
+					}
+				} else { // if platform
+					if (!rm.hasRole("platform") && !rm.hasRole("platform_entry_only")
+							&& !rm.hasRole("platform_exit_only")) {
+						RelationMember newMember = new RelationMember("platform", rm.getMember());
+						resultList.add(newMember);
+					} else {
+						resultList.add(rm);
+					}
+				}
+
+			}
+		}
+
+		return resultList;
+	}
+
+	/**
+	 * Returns a list of other (not stop-related) route relation members with
+	 * corrected roles (if necessary)
+	 * 
+	 * @return list of other (not stop-related) route relation members
+	 */
+	protected static List<RelationMember> listNotStopMembers(Relation r) {
+
+		List<RelationMember> resultList = new ArrayList<RelationMember>();
+
+		for (RelationMember rm : r.getMembers()) {
+
+			if (!RouteUtils.isPTStop(rm)) {
+
+				if (rm.hasRole("forward") || rm.hasRole("backward")) {
+					RelationMember newMember = new RelationMember("", rm.getMember());
+					resultList.add(newMember);
+				} else {
+
+					resultList.add(rm);
+
+				}
+			}
+
+		}
+
+		return resultList;
+	}
 
 }
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java	(revision 32582)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java	(revision 32585)
@@ -299,4 +299,7 @@
 		commands.add(command2);
 
+		List<RelationMember> sortedRelationMembers = listStopMembers(originalRelation);
+		sortedRelationMembers.addAll(listNotStopMembers(originalRelation));
+		
 		List<OsmDataLayer> listOfLayers = Main.getLayerManager().getLayersOfType(OsmDataLayer.class);
 		for (OsmDataLayer osmDataLayer : listOfLayers) {
@@ -304,5 +307,6 @@
 
 				final OsmDataLayer layerParameter = osmDataLayer;
-				final Relation relationParameter = originalRelation;
+				final Relation relationParameter = new Relation(originalRelation);
+				relationParameter.setMembers(sortedRelationMembers);
 				final Collection<OsmPrimitive> zoomParameter = primitivesToZoom;
 
@@ -338,4 +342,5 @@
 		RelationDialogManager.getRelationDialogManager().register(layer, r, editor);
 		editor.setVisible(true);
+		
 
 
