Index: plugins/alignways/build.xml
===================================================================
--- plugins/alignways/build.xml	(revision 33132)
+++ plugins/alignways/build.xml	(working copy)
@@ -13,6 +13,7 @@
     <property name="plugin.description" value="Makes a pair of selected way segments parallel by rotating one of them around a chosen pivot."/>
     <property name="plugin.icon" value="images/alignways.png"/>
     <property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/AlignWayS"/>
+    <property name="plugin.canloadatruntime" value="true"/>
 
     <!-- ** include targets that all plugins have in common ** -->
     <import file="../build-common.xml"/>
Index: plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java
===================================================================
--- plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java	(revision 33132)
+++ plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java	(working copy)
@@ -12,6 +12,7 @@
 import java.awt.geom.Line2D;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Objects;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
@@ -113,35 +114,21 @@
 
      @Override
      public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((segment == null) ? 0 : segment.hashCode());
-        result = prime * result
-                + ((segmentColor == null) ? 0 : segmentColor.hashCode());
-        return result;
+        if (segment == null) {
+            return System.identityHashCode(this);
+        }
+
+        // hashCode and equals should be consistent during the lifetime of this segment,
+        // otherwise the temporary mapview overlay will not be properly removed on destroy()
+        return segment.hashCode();
      }
 
-     @Override
-     public boolean equals(Object obj) {
-         if (this == obj)
-             return true;
-         if (obj == null)
-             return false;
-         if (!(obj instanceof AlignWaysSegment))
-             return false;
-         AlignWaysSegment other = (AlignWaysSegment) obj;
-         if (segment == null) {
-             if (other.segment != null)
-                 return false;
-         } else if (!segment.equals(other.segment))
-             return false;
-         /* Segment colour is ignored in comparison
-        if (segmentColor == null) {
-            if (other.segmentColor != null)
-                return false;
-        } else if (!segmentColor.equals(other.segmentColor))
-            return false;
-          */
-         return true;
-     }
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof AlignWaysSegment)) return false;
+        AlignWaysSegment that = (AlignWaysSegment) o;
+        return Objects.equals(segment, that.segment);
+    }
+
 }
