Index: src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java	(revision 4459)
+++ src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java	(working copy)
@@ -67,9 +67,7 @@
 		
 		POLYGON_ALL("all",                FeatureKind.POLYGON,  false, false, true,  true)
 			{ @Override public boolean mapFlags(boolean hasIn, boolean hasOn, boolean hasOut) {return !hasOut;} },
-//		POLYGON_ANY("any",                FeatureKind.POLYGON,  true,  false, false, false)
-// problem with test b14 on the cut polygons and isLineInShape that goes away when merged. TODO: investigate sometime
-		POLYGON_ANY("any",                FeatureKind.POLYGON,  true,  false, false, true)
+		POLYGON_ANY("any",                FeatureKind.POLYGON,  true,  false, false, false)
 			{ @Override public boolean mapFlags(boolean hasIn, boolean hasOn, boolean hasOut) {return hasIn || !hasOut;} };
 
 /* thoughts for ON methods for polyons and the hasOn flag
Index: src/uk/me/parabola/util/IsInUtil.java
===================================================================
--- src/uk/me/parabola/util/IsInUtil.java	(revision 4458)
+++ src/uk/me/parabola/util/IsInUtil.java	(working copy)
@@ -57,7 +57,7 @@
 	}
 
 	public static void mergePolygons(Set<Way> polygons, List<List<Coord>> outers, List<List<Coord>> holes) {
-	// combine all polygons which intersect the bbox of the element if possible
+		// combine all polygons which intersect the bbox of the element if possible
 		Path2D.Double path = new Path2D.Double();
 		for (Way polygon : polygons) {
 			path.append(Java2DConverter.createPath2D(polygon.getPoints()), false);
@@ -75,6 +75,7 @@
 		TOUCHING, CROSSING, SPLITTING, JOINING,SIMILAR, DOUBLE_SPIKE
 	}
 	
+	private static final double EPS = 0.02;
 	
 	public static int isLineInShape(List<Coord> lineToTest, List<Coord> shape, Area elementBbox) {
 		final int n = lineToTest.size();
@@ -86,7 +87,7 @@
 			Coord p11 = shape.get(i);
 			Coord p12 = shape.get(i + 1);
 			if (p11.highPrecEquals(p12)) {
-				// maybe we should even skip very short segments (< 0.01 m)?
+				// maybe we should even skip very short segments (< EPS m)?
 				continue;
 			}
 			// check if shape segment is clearly below, above, right or left of bbox
@@ -99,7 +100,7 @@
 				Coord p21 = lineToTest.get(k);
 				Coord p22 = lineToTest.get(k + 1);
 				if (p21.highPrecEquals(p22)) {
-					// maybe we should even skip very short segments (< 0.01 m)?
+					// maybe we should even skip very short segments (< EPS m)?
 					continue;
 				}
 				Coord inter = Utils.getSegmentSegmentIntersection(p11, p12, p21, p22);
@@ -106,7 +107,7 @@
 				if (inter != null) {
 					// segments have at least one common point 
 					boolean isCrossing = false;
-					if (inter.distance(p21) < 0.01) {
+					if (inter.distance(p21) < EPS) {
 						onBoundary.set(k);
 						if (k == 0) {
 							// first segment of line and first point on boundary
@@ -157,9 +158,13 @@
 								}
 							}
 						}
-					} else if (inter.distance(p22) < 0.01) {
+					} else if (inter.distance(p22) < EPS) {
 						onBoundary.set(k + 1);
 						// handle intersection on next iteration
+					} else if (inter.distance(p11) < EPS || inter.distance(p12) < EPS) {
+						// intersection is very close to end of shape segment
+						if (inter.distToLineSegment(p21, p22) > EPS) 
+							isCrossing = true;
 					} else {
 						isCrossing = true;
 					}
@@ -199,7 +204,6 @@
 		for (int i = 0; i < n-1; i++) {
 			Coord p1 = lineToTest.get(i);
 			Coord p2 = lineToTest.get(i + 1);
-			// TODO: may not work with b14 (element is inner ring in mp)
 			if (!isOnOrCloseToEdgeOfShape(shape, p1, p2)) {
 				Coord pTest = p1.makeBetweenPoint(p2, 0.01);
 				int resMidPoint = isPointInShape(pTest, shape);
