Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/IncompleteMembersDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/IncompleteMembersDownloadThread.java	(revision 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/IncompleteMembersDownloadThread.java	(revision 32353)
@@ -3,4 +3,5 @@
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import javax.swing.JOptionPane;
@@ -8,6 +9,9 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.gui.io.DownloadPrimitivesWithReferrersTask;
 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils;
@@ -32,21 +36,49 @@
 				ArrayList<PrimitiveId> list = new ArrayList<>();
 
-				// add all route relations that are of public_transport version 2:
+				// add all route relations that are of public_transport version
+				// 2:
 				Collection<Relation> allRelations = Main.getLayerManager().getEditDataSet().getRelations();
 				for (Relation currentRelation : allRelations) {
 					if (RouteUtils.isTwoDirectionRoute(currentRelation)) {
 						list.add(currentRelation);
+						for (RelationMember rm : currentRelation.getMembers()) {
+							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")) {
+								List<OsmPrimitive> referrers = rm.getMember().getReferrers();
+								for (OsmPrimitive referrer : referrers) {
+									if (referrer.getType().equals(OsmPrimitiveType.RELATION)
+											&& referrer.hasTag("public_transport", "stop_area")) {
+										list.add(referrer);
+										// TODO: this may never be executed
+										// because the platform is an incomplete
+										// member yet.
+									}
+								}
+							}
+						}
 					}
 				}
-				
+
 				// add all stop_positions:
 				Collection<Node> allNodes = Main.getLayerManager().getEditDataSet().getNodes();
-				for (Node currentNode: allNodes) {
+				for (Node currentNode : allNodes) {
 					if (currentNode.hasTag("public_transport", "stop_position")) {
-						list.add(currentNode);
+						List<OsmPrimitive> referrers = currentNode.getReferrers();
+						boolean parentWayExists = false;
+						for (OsmPrimitive referrer : referrers) {
+							if (referrer.getType().equals(OsmPrimitiveType.WAY)) {
+								parentWayExists = true;
+								break;
+							}
+						}
+						if (!parentWayExists) {
+							list.add(currentNode);
+
+						}
+
 					}
 				}
-				
-				
+
 				DownloadPrimitivesWithReferrersTask task = new DownloadPrimitivesWithReferrersTask(false, list, false,
 						true, null, null);
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java	(revision 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java	(revision 32353)
@@ -3,4 +3,6 @@
 import java.util.ArrayList;
 import java.util.List;
+
+import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.data.osm.Relation;
@@ -40,4 +42,5 @@
 
 			if (RouteUtils.isPTStop(member)) {
+				
 				// check if there are consecutive elements that belong to the
 				// same stop:
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 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java	(revision 32353)
@@ -1,3 +1,7 @@
 package org.openstreetmap.josm.plugins.pt_assistant.data;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -11,7 +15,5 @@
 	private Node stopPosition = null;
 	private OsmPrimitive platform = null;
-	private Relation stopArea = null;
 	
-	/* Name of this stop */
 	private String name = "";
 
@@ -20,24 +22,18 @@
 		super(other);
 
-		if (other.getRole().equals("stop") && other.getType().equals(OsmPrimitiveType.NODE)) {
+		if ((other.hasRole("stop") || other.hasRole("stop_entry_only") || other.hasRole("stop_exit_only"))&& other.getType().equals(OsmPrimitiveType.NODE)) {
+
 			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")) {
+
 			this.platform = other.getMember();
-		} else if (other.getRole().equals("stop_area") && other.getType().equals(OsmPrimitiveType.RELATION)) {
-			this.stopArea = other.getRelation();
-			for (RelationMember rm: stopArea.getMembers()) {
-				if (rm.getRole().equals("stop") && rm.isNode()) {
-					this.stopPosition = rm.getNode();
-				}
-				if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")) {
-					this.platform = rm.getMember();
-				}
-			}
+			this.name = platform.get("name");
+
 		} else {
 			throw new IllegalArgumentException("The RelationMember type does not match its role");
 		}
-		
-		this.name = other.getMember().get("name");
 
 	}
@@ -58,5 +54,5 @@
 
 		// add stop position:
-		if (member.getRole().equals("stop")) {
+		if (member.hasRole("stop") || member.hasRole("stop_entry_only") || member.hasRole("stop_exit_only")) {
 			if (member.getType().equals(OsmPrimitiveType.NODE) && stopPosition == null) {
 				this.stopPosition = member.getNode();
@@ -74,30 +70,40 @@
 		}
 
-		// add stop_area:
-		if (member.getRole().equals("stop_area") && member.getType().equals(OsmPrimitiveType.RELATION)) {
-			if (stopArea == null) {
-				stopArea = member.getRelation();
-				for (RelationMember rm: stopArea.getMembers()) {
-					if (rm.getRole().equals("stop") && rm.isNode()) {
-						this.stopPosition = rm.getNode();
-					}
-					if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")) {
-						this.platform = rm.getMember();
-					}
-				}
-				return true;
-			}
-		}
-
 		return false;
 
 	}
-	
+
+	/**
+	 * Returns the stop_position for this PTstop. If the stop_position is not
+	 * available directly, the method searches for a stop_area relation
+	 * 
+	 * @return
+	 */
 	public Node getStopPosition() {
+
+		// List<OsmPrimitive> referrers = platform.getReferrers();
+		// List<Relation> stopAreaRelations = new ArrayList<>();
+		// for (OsmPrimitive referrer: referrers) {
+		// if (referrer.getType().equals(OsmPrimitiveType.RELATION) &&
+		// referrer.hasTag("public_tranport", "stop_area")) {
+		// stopAreaRelations.add((Relation)referrer);
+		// }
+		// }
+		//
+		// for (Relation stopArea: stopAreaRelations) {
+		// for (RelationMember rm: stopArea.getMembers()) {
+		// if (rm.hasRole("stop") && rm.getType().equals(OsmPrimitiveType.NODE))
+		// {
+		// this.stopPosition = rm.getNode();
+		// }
+		// }
+		// }
+
 		return this.stopPosition;
 	}
-	
+
 	/**
 	 * Returns platform (including platform_entry_only and platform_exit_only)
+	 * 
 	 * @return
 	 */
@@ -106,11 +112,54 @@
 	}
 	
-	public Relation getStopArea() {
-		return this.stopArea;
-	}
-	
 	public String getName() {
 		return this.name;
 	}
 
+	public void setStopPosition(Node newStopPosition) {
+
+		this.stopPosition = newStopPosition;
+
+	}
+
+	/**
+	 * Finds potential stop_positions of the platform of this PTStop. It only
+	 * makes sense to call this method if the stop_position attribute is null.
+	 * The stop_positions are potential because they may refer to a different
+	 * route, which this method does not check.
+	 * 
+	 * @return List of potential stop_positions for this PTStop
+	 */
+	public List<Node> findPotentialStopPositions() {
+
+		ArrayList<Node> potentialStopPositions = new ArrayList<>();
+
+		if (platform == null) {
+			return potentialStopPositions;
+		}
+
+		// 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/data/PTWay.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTWay.java	(revision 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTWay.java	(revision 32353)
@@ -84,4 +84,5 @@
 		return false;
 	}
+	
 
 }
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 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java	(revision 32353)
@@ -61,25 +61,30 @@
 
 		if (rm.getType().equals(OsmPrimitiveType.NODE)) {
-			return true;
+
+			if (rm.getNode().hasTag("public_transport", "stop_position")
+					|| rm.getNode().hasTag("public_transport", "platform")
+					|| rm.getNode().hasTag("public_transport", "platform_entry_only")
+					|| rm.getNode().hasTag("public_transport", "platform_exit_only")
+					|| rm.getNode().hasTag("highway", "platform")
+					|| rm.getNode().hasTag("highway", "platform_entry_only")
+					|| rm.getNode().hasTag("highway", "platform_exit_only")
+					|| rm.getNode().hasTag("railway", "platform")
+					|| rm.getNode().hasTag("railway", "platform_entry_only")
+					|| rm.getNode().hasTag("railway", "platform_exit_only")) {
+				return true;
+			}
+
 		}
 
-		if (rm.getType().equals(OsmPrimitiveType.RELATION)) {
-			if (rm.getRole().equals("stop_area")) {
+		if (rm.getType().equals(OsmPrimitiveType.WAY)) {
+			if (rm.getWay().hasTag("public_transport", "platform")
+					|| rm.getWay().hasTag("public_transport", "platform_entry_only")
+					|| rm.getWay().hasTag("public_transport", "platform_exit_only")
+					|| rm.getWay().hasTag("highway", "platform") || rm.getWay().hasTag("highway", "platform_entry_only")
+					|| rm.getWay().hasTag("highway", "platform_exist_only") || rm.getWay().hasTag("railway", "platform")
+					|| rm.getWay().hasTag("railway", "platform_entry_only")
+					|| rm.getWay().hasTag("railway", "platform_exit_only")) {
 				return true;
-			} else if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")){
-				return true;
-			} else {
-				return false;
 			}
-		}
-
-		Way w = rm.getWay();
-
-		if (w.hasTag("public_transport", "platform") || w.hasTag("highway", "platform")
-				|| w.hasTag("railway", "platform") || w.hasTag("public_transport", "platform_entry_only")
-				|| w.hasTag("highway", "platform_entry_only") || w.hasTag("railway", "platform_entry_only")
-				|| w.hasTag("public_transport", "platform_exit_only") || w.hasTag("highway", "platform_exit_only")
-				|| w.hasTag("railway", "platform_exit_only")) {
-			return true;
 		}
 
@@ -101,4 +106,5 @@
 
 		return !isPTStop(rm);
+
 	}
 
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java	(revision 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java	(revision 32353)
@@ -43,8 +43,10 @@
 	@Override
 	public void visit(Relation r) {
+		
 
 		if (!RouteUtils.isTwoDirectionRoute(r)) {
 			return;
 		}
+		
 
 		// Download incomplete members. If the download does not work, finish.
@@ -55,4 +57,8 @@
 			}
 		}
+		
+		if (r.hasIncompleteMembers()) {
+			return;
+		}
 
 		// Check individual ways using the oneway direction test and the road
@@ -60,4 +66,5 @@
 		WayChecker wayChecker = new WayChecker(r, this);
 		this.errors.addAll(wayChecker.getErrors());
+		
 
 		if (this.errors.isEmpty()) {
@@ -89,4 +96,5 @@
 					t.wait();
 				} catch (InterruptedException e) {
+					// TODO: give the user a message that testing stops
 					return false;
 				}
@@ -184,6 +192,13 @@
 	
 	private void proceedAfterSorting(Relation r) {
-		// TODO
-		performDummyTest(r);
+		
+		
+		
+		SegmentChecker segmentChecker = new SegmentChecker(r, this);
+		segmentChecker.performFirstStopTest();
+		segmentChecker.performLastStopTest();
+		// TODO: perform segment test
+		this.errors.addAll(segmentChecker.getErrors());
+//		performDummyTest(r);
 	}
 
Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java	(revision 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java	(revision 32353)
@@ -6,4 +6,5 @@
 import java.util.List;
 
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -39,8 +40,8 @@
 
 		super(relation, test);
-
+		
 		this.manager = new PTRouteDataManager(relation);
 		this.assigner = new StopToWayAssigner(manager.getPTWays());
-
+		
 	}
 
@@ -58,47 +59,74 @@
 
 	private void performEndStopTest(PTStop endStop) {
-		if (manager.getPTStopCount() < 2) {
-			// it does not make sense to check a route that has less than 2
-			// stops
-			return;
-		}
+
+		/*
+		 * This test checks: (1) that a stop position exists; (2) that it is the
+		 * first or last node of its parent ways which belong to this route.
+		 */
 
 		if (endStop.getStopPosition() == null) {
-			List<Relation> primitives = new ArrayList<>(1);
-			primitives.add(relation);
-			List<OsmPrimitive> highlighted = new ArrayList<>(1);
-			highlighted.add(endStop.getPlatform());
-			TestError e = new TestError(this.test, Severity.WARNING,
-					tr("PT: Route should start and end with a stop_position"),
-					PTAssitantValidatorTest.ERROR_CODE_END_STOP, primitives, highlighted);
-			this.errors.add(e);
-			return;
-		}
 
-		PTWay endWay = assigner.get(endStop);
+			List<Node> potentialStopPositionList = endStop.findPotentialStopPositions();
+			List<Node> stopPositionsOfThisRoute = new ArrayList<>();
+			boolean containsAtLeastOneStopPositionAsFirstOrLastNode = false;
 
-		boolean found = false;
-		List<Way> primitivesOfEndWay = endWay.getWays();
-		for (Way primitiveWay : primitivesOfEndWay) {
-			if (primitiveWay.firstNode() == endStop.getStopPosition()
-					|| primitiveWay.lastNode() == endStop.getStopPosition()) {
-				found = true;
+			for (Node potentialStopPosition : potentialStopPositionList) {
+
+				int belongsToWay = belongsToAWayOfThisRoute(potentialStopPosition);
+
+				if (belongsToWay == 0) {
+					stopPositionsOfThisRoute.add(potentialStopPosition);
+					containsAtLeastOneStopPositionAsFirstOrLastNode = true;
+				}
+
+				if (belongsToWay == 1) {
+					stopPositionsOfThisRoute.add(potentialStopPosition);
+				}
 			}
 
-		}
+			if (stopPositionsOfThisRoute.isEmpty()) {
+				List<Relation> primitives = new ArrayList<>(1);
+				primitives.add(relation);
+				List<OsmPrimitive> highlighted = new ArrayList<>(1);
+				highlighted.add(endStop.getPlatform());
+				TestError e = new TestError(this.test, Severity.WARNING,
+						tr("PT: Route should start and end with a stop_position"),
+						PTAssitantValidatorTest.ERROR_CODE_END_STOP, primitives, highlighted);
+				this.errors.add(e);
+				return;
+			}
+			
+			if (stopPositionsOfThisRoute.size() == 1) {
+				endStop.setStopPosition(stopPositionsOfThisRoute.get(0));
+			}
 
-		if (!found) {
-			List<Relation> primitives = new ArrayList<>(1);
-			primitives.add(relation);
-			List<OsmPrimitive> highlighted = new ArrayList<>();
-			for (Way w : endWay.getWays()) {
-				if (w.getNodes().contains(endStop.getStopPosition())) {
-					highlighted.add(w);
-				}
+			// At this point, there is at least one stop_position for this
+			// endStop:
+			if (!containsAtLeastOneStopPositionAsFirstOrLastNode) {
+				List<Relation> primitives = new ArrayList<>(1);
+				primitives.add(relation);
+				List<OsmPrimitive> highlighted = new ArrayList<>();
+				highlighted.addAll(stopPositionsOfThisRoute);
+
+				TestError e = new TestError(this.test, Severity.WARNING, tr("PT: First or last way needs to be split"),
+						PTAssitantValidatorTest.ERROR_CODE_SPLIT_WAY, primitives, highlighted);
+				this.errors.add(e);
 			}
-			TestError e = new TestError(this.test, Severity.WARNING,
-					tr("PT: First or last way needs to be split"),
-					PTAssitantValidatorTest.ERROR_CODE_SPLIT_WAY, primitives, highlighted);
-			this.errors.add(e);
+
+		} else {
+			
+			// if the stop_position is known:
+			int belongsToWay = this.belongsToAWayOfThisRoute(endStop.getStopPosition());
+			
+			if (belongsToWay == 1) {
+				
+				List<Relation> primitives = new ArrayList<>(1);
+				primitives.add(relation);
+				List<OsmPrimitive> highlighted = new ArrayList<>();
+				highlighted.add(endStop.getStopPosition());
+				TestError e = new TestError(this.test, Severity.WARNING, tr("PT: First or last way needs to be split"),
+						PTAssitantValidatorTest.ERROR_CODE_SPLIT_WAY, primitives, highlighted);
+				this.errors.add(e);
+			}
 		}
 
@@ -109,3 +137,37 @@
 	}
 
+	/**
+	 * Checks if the given node belongs to the ways of this route.
+	 * 
+	 * @param node
+	 *            Node to be checked
+	 * @return 1 if belongs only as an inner node, 0 if belongs as a first or
+	 *         last node for at least one way, -1 if does not belong to any way.
+	 */
+	private int belongsToAWayOfThisRoute(Node node) {
+
+		boolean contains = false;
+
+		List<PTWay> ptways = manager.getPTWays();
+		for (PTWay ptway : ptways) {
+			List<Way> ways = ptway.getWays();
+			for (Way way : ways) {
+				if (way.containsNode(node)) {
+
+					if (way.firstNode().equals(node) || way.lastNode().equals(node)) {
+						return 0;
+					}
+
+					contains = true;
+				}
+			}
+		}
+
+		if (contains) {
+			return 1;
+		}
+
+		return -1;
+	}
+
 }
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 32352)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java	(revision 32353)
@@ -30,11 +30,14 @@
 		super(relation, test);
 
-		this.performDirectionTest();
-		this.performRoadTypeTest();
+		if (!relation.hasIncompleteMembers()) {
+			this.performDirectionTest();
+			this.performRoadTypeTest();
+		}
+
 
 	}
 
 	private void performRoadTypeTest() {
-
+		
 		if (!relation.hasTag("route", "bus") && !relation.hasTag("route", "trolleybus")
 				&& !relation.hasTag("route", "share_taxi")) {
