diff --git a/rsvg-path.c b/rsvg-path.c
index 69c7d47..e4a4e5b 100644
--- a/rsvg-path.c
+++ b/rsvg-path.c
@@ -607,13 +607,11 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
                 sign = 1;
             }
         } else if (c == '.') {
-            if (!in_num) {
-                in_frac = TRUE;
-                val = 0;
-            }
-            else if (in_frac) {
-                rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
-                in_frac = FALSE;
+            if (in_frac || !in_num) {
+                if (in_frac) {
+                    rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
+                }
+                in_num = TRUE;
                 in_exp = FALSE;
                 exp = 0;
                 exp_sign = 1;
@@ -621,10 +619,7 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
                 val = 0;
                 sign = 1;
             }
-            else {
-                in_frac = TRUE;
-            }
-            in_num = TRUE;
+            in_frac = TRUE;
             frac = 1;
         } else if ((c == 'E' || c == 'e') && in_num) {
             in_exp = TRUE;
@@ -637,6 +632,8 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
             /* end of number */
             rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
             in_num = FALSE;
+            in_frac = FALSE;
+            in_exp = FALSE;
         }
 
         if (c == '\0')
