Index: /trunk/data_nodist/projection-regression-test-data.csv
===================================================================
--- /trunk/data_nodist/projection-regression-test-data.csv	(revision 5238)
+++ /trunk/data_nodist/projection-regression-test-data.csv	(revision 5239)
@@ -495,6 +495,6 @@
 EPSG:3812
   ll  50.76787953358437 3.4513353977071453
-  en  585284.6677650046 662323.5758590293
-  ll2 50.76787953358439 3.4513353977071453
+  en  585284.6677650047 662323.5758590293
+  ll2 50.76787953358439 3.451335397707146
 EPSG:21781
   ll  46.582471410091934 8.159223152110604
@@ -523,5 +523,5 @@
 EPSG:27561
   ll  48.687023294540744 9.13470536591202
-  en  1099861.4328694288 132165.3475888513
+  en  1099861.4328694288 132165.3475888506
   ll2 48.687023294540765 9.134705365912021
 EPSG:27562
@@ -531,6 +531,6 @@
 EPSG:27563
   ll  46.443136133672226 5.992820527372115
-  en  881070.7805340261 466693.7656533603
-  ll2 46.44313613367226 5.992820527372114
+  en  881070.7805340262 466693.7656533603
+  ll2 46.44313613367226 5.992820527372113
 EPSG:27564
   ll  43.42400252536329 0.5163786716368639
Index: /trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java	(revision 5238)
+++ /trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java	(revision 5239)
@@ -98,5 +98,16 @@
 
     protected static final double convertDegreeMinuteSecond(double degree, double minute, double second) {
-        return degree + convertMinuteSecond(minute, second);
+        return degree + (minute/60.0) + (second/3600.0);
     }
+    
+    public void dump() {
+        System.err.println("x_0="+x_0);
+        System.err.println("y_0="+y_0);
+        System.err.println("lon_0="+lon_0);
+        System.err.println("k_0="+k_0);
+        System.err.println("ellps="+ellps);
+        System.err.println("proj="+proj);
+        System.err.println("datum="+datum);
+    }
+
 }
Index: /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 5238)
+++ /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 5239)
@@ -16,5 +16,4 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.projection.CustomProjection.Param;
 import org.openstreetmap.josm.data.projection.datum.CentricDatum;
 import org.openstreetmap.josm.data.projection.datum.Datum;
@@ -44,46 +43,41 @@
     protected Bounds bounds;
 
-    protected static class Param {
+    protected static enum Param {
+
+        x_0("x_0", true),
+        y_0("y_0", true),
+        lon_0("lon_0", true),
+        k_0("k_0", true),
+        ellps("ellps", true),
+        a("a", true),
+        es("es", true),
+        rf("rf", true),
+        f("f", true),
+        b("b", true),
+        datum("datum", true),
+        towgs84("towgs84", true),
+        nadgrids("nadgrids", true),
+        proj("proj", true),
+        lat_0("lat_0", true),
+        lat_1("lat_1", true),
+        lat_2("lat_2", true),
+        wktext("wktext", false),  // ignored
+        units("units", true),     // ignored
+        no_defs("no_defs", false),
+        init("init", true),
+        // JOSM extension, not present in PROJ.4
+        bounds("bounds", true);
+
         public String key;
         public boolean hasValue;
 
-        public final static Param x_0 = new Param("x_0", true);
-        public final static Param y_0 = new Param("y_0", true);
-        public final static Param lon_0 = new Param("lon_0", true);
-        public final static Param k_0 = new Param("k_0", true);
-        public final static Param ellps = new Param("ellps", true);
-        public final static Param a = new Param("a", true);
-        public final static Param es = new Param("es", true);
-        public final static Param rf = new Param("rf", true);
-        public final static Param f = new Param("f", true);
-        public final static Param b = new Param("b", true);
-        public final static Param datum = new Param("datum", true);
-        public final static Param towgs84 = new Param("towgs84", true);
-        public final static Param nadgrids = new Param("nadgrids", true);
-        public final static Param proj = new Param("proj", true);
-        public final static Param lat_0 = new Param("lat_0", true);
-        public final static Param lat_1 = new Param("lat_1", true);
-        public final static Param lat_2 = new Param("lat_2", true);
-        public final static Param wktext = new Param("wktext", false);  // ignored
-        public final static Param units = new Param("units", true);     // ignored
-        public final static Param no_defs = new Param("no_defs", false);
-        public final static Param init = new Param("init", true);
-        // JOSM extension, not present in PROJ.4
-        public final static Param bounds = new Param("bounds", true);
-
-        public final static Set<Param> params = new HashSet<Param>(Arrays.asList(
-                x_0, y_0, lon_0, k_0, ellps, a, es, rf, f, b, datum, towgs84,
-                nadgrids, proj, lat_0, lat_1, lat_2, wktext, units, no_defs, 
-                init, bounds
-        ));
-
         public final static Map<String, Param> paramsByKey = new HashMap<String, Param>();
         static {
-            for (Param p : params) {
+            for (Param p : Param.values()) {
                 paramsByKey.put(p.key, p);
             }
         }
 
-        public Param(String key, boolean hasValue) {
+        Param(String key, boolean hasValue) {
             this.key = key;
             this.hasValue = hasValue;
@@ -116,5 +110,5 @@
             bounds = new Bounds(
                     new LatLon(-85.05112877980659, -180.0),
-                    new LatLon(85.05112877980659, 180.0));
+                    new LatLon(85.05112877980659, 180.0), true);
         } else {
             Map<String, String> parameters = parseParameterList(pref);
@@ -384,9 +378,10 @@
         final String FLOAT = "(\\d+(\\.\\d*)?)";
         boolean dms = false;
+        double deg = 0.0, min = 0.0, sec = 0.0;
         // degrees
         m = Pattern.compile("^"+FLOAT+"d").matcher(s);
         if (m.find()) {
             s = s.substring(m.end());
-            value += Double.parseDouble(m.group(1));
+            deg = Double.parseDouble(m.group(1));
             dms = true;
         }
@@ -395,5 +390,5 @@
         if (m.find()) {
             s = s.substring(m.end());
-            value += Double.parseDouble(m.group(1)) / 60.0;
+            min = Double.parseDouble(m.group(1));
             dms = true;
         }
@@ -402,9 +397,11 @@
         if (m.find()) {
             s = s.substring(m.end());
-            value += Double.parseDouble(m.group(1)) / 3600.0;
+            sec = Double.parseDouble(m.group(1));
             dms = true;
         }
         // plain number (in degrees)
-        if (!dms) {
+        if (dms) {
+            value = deg + (min/60.0) + (sec/3600.0);
+        } else {
             m = Pattern.compile("^"+FLOAT).matcher(s);
             if (m.find()) {
@@ -433,14 +430,4 @@
     }
 
-    public void dump() {
-        System.err.println("x_0="+x_0);
-        System.err.println("y_0="+y_0);
-        System.err.println("lon_0="+lon_0);
-        System.err.println("k_0="+k_0);
-        System.err.println("ellps="+ellps);
-        System.err.println("proj="+proj);
-        System.err.println("datum="+datum);
-    }
-
     @Override
     public Integer getEpsgCode() {
