Index: applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java	(revision 22757)
+++ applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java	(revision 22758)
@@ -56,30 +56,8 @@
 				if (!(c instanceof AlignWaysRotateCommand &&
 						affectedNodes.equals(((AlignWaysRotateCommand) c).getRotatedNodes()))) {
-					Main.main.undoRedo.add(c = new AlignWaysRotateCommand());
-				}
-
-				// Warn user if reference and alignee segment nodes are common:
-				// We cannot align two connected segment
-				if (((AlignWaysRotateCommand) c).areSegsConnected()) {
-					// Revert move
-					((AlignWaysRotateCommand) c).undoCommand();
-					JOptionPane.showMessageDialog(Main.parent,
-							tr("You cannot align connected segments.\n"
-									+ "Please select two segments that don''t share any nodes."),
-									tr("AlignWayS message"), JOptionPane.WARNING_MESSAGE);
-					return;
-				}
-
-				for (Node n : affectedNodes) {
-					if (n.getCoor().isOutSideWorld()) {
-						// Revert move
-						((AlignWaysRotateCommand) c).undoCommand();
-						JOptionPane.showMessageDialog(Main.parent,
-								tr("Aligning would result nodes outside the world.\n" +
-								"Your action is being reverted."),
-								tr("AlignWayS message"), JOptionPane.WARNING_MESSAGE);
-						return;
+					c = new AlignWaysRotateCommand();
+					if (actionValid((AlignWaysRotateCommand)c, affectedNodes)) {
+						Main.main.undoRedo.add(c);
 					}
-
 				}
 
@@ -89,3 +67,38 @@
 	}
 
+
+	/**
+	 * Validates the circumstances of the alignment (rotation) command to be executed.
+	 * @param c Command to be verified.
+	 * @param affectedNodes Nodes to be affected by the action.
+	 * @return true if the aligning action can be done, false otherwise.
+	 */
+	private boolean actionValid(AlignWaysRotateCommand c, Collection<Node> affectedNodes) {
+		// Deny action if reference and alignee segment cannot be aligned
+		if (!c.areSegsAlignable()) {
+			JOptionPane.showMessageDialog(Main.parent,
+					tr("Please select two segments that don''t share any nodes or put the pivot on their common node.\n" +
+					"Your action is being igonred."),
+					tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
+			return false;
+		}
+
+		// Deny action if the nodes would end up outside world
+		for (Node n : affectedNodes) {
+			if (n.getCoor().isOutSideWorld()) {
+				// Revert move
+				(c).undoCommand();
+				JOptionPane.showMessageDialog(Main.parent,
+						tr("Aligning would result nodes outside the world.\n" +
+						"Your action is being ignored."),
+						tr("AlignWayS: Alignment denied"), JOptionPane.WARNING_MESSAGE);
+				return false;
+			}
+
+		}
+
+		// Action valid
+		return true;
+	}
+
 }
Index: applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRotateCommand.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRotateCommand.java	(revision 22757)
+++ applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRotateCommand.java	(revision 22758)
@@ -81,14 +81,4 @@
 		this.nodes = algnSeg.getSegmentEndPoints();
 
-		for (Node n : this.nodes) {
-			OldState os = new OldState();
-			os.latlon = new LatLon(n.getCoor());
-			os.eastNorth = n.getEastNorth();
-			os.ws = algnWS;
-			os.modified = n.isModified();
-			oldState.put(n, os);
-		}
-		oldWS.push(algnWS);
-
 		EastNorth enRefNode1 = refWS.way.getNode(refWS.lowerIndex)
 		.getEastNorth();
@@ -119,5 +109,5 @@
 		 */
 
-		rotateNodes(true);
+		// rotateNodes(true);
 
 	}
@@ -130,4 +120,18 @@
 	 */
 	private void rotateNodes(boolean setModified) {
+
+		// "Backup" state
+		WaySegment algnWS = algnSeg.getSegment();
+		for (Node n : this.nodes) {
+			OldState os = new OldState();
+			os.latlon = new LatLon(n.getCoor());
+			os.eastNorth = n.getEastNorth();
+			os.ws = algnWS;
+			os.modified = n.isModified();
+			oldState.put(n, os);
+		}
+		oldWS.push(algnWS);
+
+		// Rotate
 		for (Node n : nodes) {
 			double cosPhi = Math.cos(rotationAngle);
@@ -168,5 +172,5 @@
 	public JLabel getDescription() {
 		return new JLabel(tr("Align way segment"), ImageProvider.get(
-					"", "alignways"), SwingConstants.HORIZONTAL);
+				"", "alignways"), SwingConstants.HORIZONTAL);
 	}
 
@@ -216,18 +220,30 @@
 	}
 
-	public boolean areSegsConnected() {
+	/** Returns true if the two selected segments are alignable.
+	 *  They are not if they are connected *and* the pivot is not the connection node.
+	 */
+	public boolean areSegsAlignable() {
 		Collection<Node> algnNodes = nodes;
 		Collection<Node> refNodes = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
 		.getRefSeg().getSegmentEndPoints();
+
+		// First check if the pivot node of the alignee exists in the reference:
+		// in this case the pivot is the shared node and alignment is possible
+		for (Node nR : refNodes) {
+			if (nR.getEastNorth().equals(pivot))
+				return true;
+		}
+
+		// Otherwise if the segments are connected, alignment is not possible
 		for (Node nA : algnNodes) {
 			for (Node nR : refNodes) {
 				if (nA.equals(nR))
-					return true;
+					return false;
 			}
 		}
 
-		return false;
-	}
-
+		// In all other cases alignment is possible
+		return true;
+	}
 
 }
Index: applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelBothState.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelBothState.java	(revision 22757)
+++ applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelBothState.java	(revision 22758)
@@ -25,5 +25,6 @@
 	public void setHelpText() {
 		Main.map.statusLine
-				.setHelpText("Shift-A: Align segments; Alt-click: Clear selection");
+		.setHelpText(AlignWaysPlugin.getAwAction().getShortcut().getKeyText() +
+				": Align segments; Alt-click: Clear selection");
 	}
 
