diff --git a/cost_function.py b/cost_function.py
index 076c912e2d72e57f13e15393c2095bfd75014ac7..6ba78fcdbdcabf0c160529a8996fdeb32f9f361a 100755
--- a/cost_function.py
+++ b/cost_function.py
@@ -166,15 +166,16 @@ for n in g.vertices():
                 = calculate_radii_rossby(properties)
             g.vp.pos_last[n] = properties[- 1]["pos"] # in degrees
         else:
-            # The number of eddies in a segment is lower than the number
-            # of days over which to average. The values will be the same
-            # except for the positions.
+            # The number of eddies in the segment is lower than or
+            # equal to the number of days over which to average. The
+            # values for the end of the segment will be the same as
+            # for the begining, except for the position.
             properties = node_to_prop(segment, e_overestim, array_d_init,
                                       handlers)
             g.vp.first_av_rad[n], g.vp.first_av_ros[n] \
                 = calculate_radii_rossby(properties)
-            g.vp.last_av_ros[n] = g.vp.first_av_ros[n]
             g.vp.last_av_rad[n] = g.vp.first_av_rad[n]
+            g.vp.last_av_ros[n] = g.vp.first_av_ros[n]
             g.vp.pos_first[n] = properties[0]["pos"] # in degrees
             g.vp.pos_last[n] = properties[- 1]["pos"] # in degrees