diff --git a/rsvg-path.c b/rsvg-path.c
index ac6fb58..7e2aff1 100644
--- a/rsvg-path.c
+++ b/rsvg-path.c
@@ -458,9 +458,9 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
     gboolean in_frac = FALSE;
     gboolean in_exp = FALSE;
     gboolean exp_wait_sign = FALSE;
-    int sign = 0;
+    int sign = 1;
     int exp = 0;
-    int exp_sign = 0;
+    int exp_sign = 1;
     double frac = 0.0;
 
     in_num = FALSE;
@@ -488,12 +488,19 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
             }
         } else if (c == '.') {
             if (!in_num) {
+                // reinitialize all variables for new number
+                in_num = TRUE;
+                in_exp = FALSE;
+                exp = 0;
+                exp_sign = 1;
+                exp_wait_sign = FALSE;
+                sign = 1;
                 in_frac = TRUE;
                 val = 0;
             }
             else if (in_frac) {
                 rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
-                in_frac = FALSE;
+                //new fractional part starts here, with detected '.', so leave in_frac = TRUE
                 in_exp = FALSE;
                 exp = 0;
                 exp_sign = 1;
@@ -511,25 +518,30 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
             exp_wait_sign = TRUE;
             exp = 0;
             exp_sign = 1;
-        } else if ((c == '+' || c == '-') && in_exp) {
+        } else if ((c == '+' || c == '-') && exp_wait_sign) {
             exp_sign = c == '+' ? 1 : -1;
+            //exp_wait_sign is set to false further down in next check for '+'/'-'
         } else if (in_num) {
             /* end of number */
             rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
+            sign = 1;
             in_num = FALSE;
         }
 
         if (c == '\0')
             break;
-        else if ((c == '+' || c == '-') && !exp_wait_sign) {
-            sign = c == '+' ? 1 : -1;
-            val = 0;
-            in_num = TRUE;
-            in_frac = FALSE;
-            in_exp = FALSE;
-            exp = 0;
-            exp_sign = 1;
-            exp_wait_sign = FALSE;
+        else if (c == '+' || c == '-') {
+            if (!exp_wait_sign) {
+                sign = c == '+' ? 1 : -1;
+                val = 0;
+                in_num = TRUE;
+                in_frac = FALSE;
+                in_exp = FALSE;
+                exp = 0;
+                exp_sign = 1;
+            } 
+            else
+                exp_wait_sign = FALSE;
         } else if (c == 'z' || c == 'Z') {
             if (ctx->param)
                 rsvg_parse_path_do_cmd (ctx, TRUE);
