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 33465)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTRouteDataManager.java	(revision 33466)
@@ -27,8 +27,8 @@
 
     /* Stores all relation members that are PTStops */
-    private List<PTStop> ptstops = new ArrayList<>();
+    private List<PTStop> ptStops = new ArrayList<>();
 
     /* Stores all relation members that are PTWays */
-    private List<PTWay> ptways = new ArrayList<>();
+    private List<PTWay> ptWays = new ArrayList<>();
 
     /*
@@ -38,5 +38,5 @@
     private Set<RelationMember> failedMembers = new HashSet<>();
 
-    public PTRouteDataManager(Relation relation) throws IllegalArgumentException {
+    public PTRouteDataManager(Relation relation) {
 
         // It is assumed that the relation is a route. Build in a check here
@@ -63,5 +63,5 @@
                         // Squared distance of 0.000004 corresponds to
                         // around 100 m
-                        if (this.calculateDistanceSq(member, prev) < 0.000001) {
+                        if (calculateDistanceSq(member, prev) < 0.000001) {
                             stopExists = true;
                         }
@@ -93,5 +93,5 @@
                     try {
                         PTStop ptstop = new PTStop(member);
-                        ptstops.add(ptstop);
+                        ptStops.add(ptstop);
                         prev = ptstop;
                     } catch (IllegalArgumentException ex) {
@@ -111,5 +111,5 @@
 
                 PTWay ptway = new PTWay(member);
-                ptways.add(ptway);
+                ptWays.add(ptway);
 
             } else {
@@ -150,5 +150,5 @@
     public PTWay getPTWay(Way inputWay) {
 
-        for (PTWay curr : ptways) {
+        for (PTWay curr : ptWays) {
 
             if (curr.isWay() && curr.getWays().get(0) == inputWay) {
@@ -170,35 +170,35 @@
 
     public List<PTStop> getPTStops() {
-        return this.ptstops;
+        return ptStops;
     }
 
     public List<PTWay> getPTWays() {
-        return this.ptways;
+        return ptWays;
     }
 
     public int getPTStopCount() {
-        return ptstops.size();
+        return ptStops.size();
     }
 
     public int getPTWayCount() {
-        return this.ptways.size();
+        return ptWays.size();
     }
 
     public PTStop getFirstStop() {
-        if (this.ptstops.isEmpty()) {
+        if (ptStops.isEmpty()) {
             return null;
         }
-        return this.ptstops.get(0);
+        return ptStops.get(0);
     }
 
     public PTStop getLastStop() {
-        if (this.ptstops.isEmpty()) {
+        if (ptStops.isEmpty()) {
             return null;
         }
-        return this.ptstops.get(ptstops.size() - 1);
+        return ptStops.get(ptStops.size() - 1);
     }
 
     public Set<RelationMember> getFailedMembers() {
-        return this.failedMembers;
+        return failedMembers;
     }
 
@@ -209,5 +209,5 @@
      */
     public Relation getRelation() {
-        return this.relation;
+        return relation;
     }
 
@@ -219,5 +219,5 @@
      */
     public PTStop getPTStop(long id) {
-        for (PTStop stop : this.ptstops) {
+        for (PTStop stop : ptStops) {
             if (stop.getStopPosition() != null && stop.getStopPosition().getId() == id) {
                 return stop;
@@ -239,5 +239,5 @@
      */
     public PTWay getPTWay(long id) {
-        for (PTWay ptway : this.ptways) {
+        for (PTWay ptway : ptWays) {
             for (Way way : ptway.getWays()) {
                 if (way.getId() == id) {
@@ -258,5 +258,5 @@
 
         List<PTWay> ptwaysThatContain = new ArrayList<>();
-        for (PTWay ptway : ptways) {
+        for (PTWay ptway : ptWays) {
             if (ptway.getWays().contains(way)) {
                 ptwaysThatContain.add(ptway);
@@ -276,5 +276,5 @@
 
         List<PTWay> ptwaysThatContain = new ArrayList<>();
-        for (PTWay ptway : ptways) {
+        for (PTWay ptway : ptWays) {
             List<Way> ways = ptway.getWays();
             if (ways.get(0).firstNode() == node || ways.get(0).lastNode() == node
@@ -295,9 +295,6 @@
     public boolean isDeadendNode(Node node) {
 
-        List<PTWay> referringPtways = this.findPTWaysThatContainAsEndNode(node);
-        if (referringPtways.size() <= 1) {
-            return true;
-        }
-        return false;
+        List<PTWay> referringPtways = findPTWaysThatContainAsEndNode(node);
+        return referringPtways.size() <= 1;
     }
 
@@ -312,7 +309,7 @@
     public PTWay getNextPTWay(PTWay ptway) {
 
-        for (int i = 0; i < ptways.size() - 1; i++) {
-            if (ptways.get(i) == ptway) {
-                return ptways.get(i + 1);
+        for (int i = 0; i < ptWays.size() - 1; i++) {
+            if (ptWays.get(i) == ptway) {
+                return ptWays.get(i + 1);
             }
         }
@@ -331,7 +328,7 @@
     public PTWay getPreviousPTWay(PTWay ptway) {
 
-        for (int i = 1; i < ptways.size(); i++) {
-            if (ptways.get(i) == ptway) {
-                return ptways.get(i - 1);
+        for (int i = 1; i < ptWays.size(); i++) {
+            if (ptWays.get(i) == ptway) {
+                return ptWays.get(i - 1);
             }
         }
@@ -352,9 +349,9 @@
         List<Integer> potentialEndIndices = new ArrayList<>();
 
-        for (int i = 0; i < ptways.size(); i++) {
-            if (ptways.get(i).getWays().contains(start)) {
+        for (int i = 0; i < ptWays.size(); i++) {
+            if (ptWays.get(i).getWays().contains(start)) {
                 potentialStartIndices.add(i);
             }
-            if (ptways.get(i).getWays().contains(end)) {
+            if (ptWays.get(i).getWays().contains(end)) {
                 potentialEndIndices.add(i);
             }
@@ -383,5 +380,5 @@
         List<PTWay> result = new ArrayList<>();
         for (int i = mostSuitablePair[0]; i <= mostSuitablePair[1]; i++) {
-            result.add(ptways.get(i));
+            result.add(ptWays.get(i));
         }
         return result;
@@ -419,4 +416,22 @@
     }
 
+   /**
+    * Returns the first way of this route
+    *
+    * @return the first way of this route
+    */
+   public Way getFirstWay() {
+       if (ptWays.isEmpty()) {
+           return null;
+       }
+
+       PTWay lastPTWay = ptWays.get(0);
+       if (lastPTWay == null || lastPTWay.getWays().isEmpty()) {
+           return null;
+       }
+
+       return lastPTWay.getWays().get(0);
+   }
+
     /**
      * Returns the last way of this route
@@ -425,8 +440,13 @@
      */
     public Way getLastWay() {
-        PTWay lastPTWay = this.ptways.get(ptways.size() - 1);
-        if (lastPTWay == null) {
+        if (ptWays.isEmpty()) {
             return null;
         }
+
+        PTWay lastPTWay = ptWays.get(ptWays.size() - 1);
+        if (lastPTWay == null || lastPTWay.getWays().isEmpty()) {
+            return null;
+        }
+
         return lastPTWay.getWays().get(lastPTWay.getWays().size() - 1);
     }
