Index: ow/templates/profile.pt
===================================================================
--- ow/templates/profile.pt	(revision 04c882dbb6a6a21c6e6c84e0dbfb4ddf31faefa4)
+++ ow/templates/profile.pt	(revision 8d726ecc435b65e5b134241d940f75ae7b58124e)
@@ -258,8 +258,14 @@
                           <tal:t i18n:translate="">Farthest distance</tal:t>
                         </span>
-                        <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_distance_wid']])">
+                        <tal:has-wid tal:condition="sport_totals['max_distance_wid'] is not None">
+                          <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_distance_wid']])">
+                            <tal:w tal:replace="round(sport_totals['max_distance'])"></tal:w>
+                            <tal:t i18n:translate="">km</tal:t>
+                          </a>
+                        </tal:has-wid>
+                        <tal:has-not-wid tal:condition="sport_totals['max_distance_wid'] is None">
                           <tal:w tal:replace="round(sport_totals['max_distance'])"></tal:w>
                           <tal:t i18n:translate="">km</tal:t>
-                        </a>
+                        </tal:has-not-wid>
                       </li>
                       <li>
@@ -267,5 +273,15 @@
                           <tal:t i18n:translate="">Longer workout</tal:t>
                         </span>
-                        <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_time_wid']])">
+                        <tal:has-wid tal:condition="sport_totals['max_time_wid'] is not None">
+                          <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_time_wid']])">
+                            <tal:hms tal:define="hms timedelta_to_hms(sport_totals['max_time'])">
+                              <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h>
+                              <tal:t i18n:translate="">hours</tal:t>,
+                              <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h>
+                              <tal:t i18n:translate="">min.</tal:t>
+                            </tal:hms>
+                          </a>
+                        </tal:has-wid>
+                        <tal:has-not-wid tal:condition="sport_totals['max_time_wid'] is None">
                           <tal:hms tal:define="hms timedelta_to_hms(sport_totals['max_time'])">
                             <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h>
@@ -274,5 +290,5 @@
                             <tal:t i18n:translate="">min.</tal:t>
                           </tal:hms>
-                        </a>
+                        </tal:has-not-wid>
                       </li>
                       <li>
@@ -280,8 +296,14 @@
                           <tal:t i18n:translate="">Higher elevation gain</tal:t>
                         </span>
-                        <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_elevation_wid']])">
+                        <tal:has-wid tal:condition="sport_totals['max_elevation_wid'] is not None">
+                          <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_elevation_wid']])">
+                            <tal:w tal:replace="round(sport_totals['max_elevation'])"></tal:w>
+                            <tal:t i18n:translate="">m</tal:t>
+                          </a>
+                        </tal:has-wid>
+                        <tal:has-not-wid tal:condition="sport_totals['max_elevation_wid'] is None">
                           <tal:w tal:replace="round(sport_totals['max_elevation'])"></tal:w>
                           <tal:t i18n:translate="">m</tal:t>
-                        </a>
+                        </tal:has-not-wid>
                       </li>
                     </ul>
@@ -328,8 +350,14 @@
                       <tal:t i18n:translate="">Farthest distance</tal:t>
                     </span>
-                    <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_distance_wid']])">
+                    <tal:has-wid tal:condition="sport_totals['max_distance_wid'] is not None">
+                      <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_distance_wid']])">
+                        <tal:w tal:replace="round(sport_totals['max_distance'])"></tal:w>
+                        <tal:t i18n:translate="">km</tal:t>
+                      </a>
+                    </tal:has-wid>
+                    <tal:has-not-wid tal:condition="sport_totals['max_distance_wid'] is None">
                       <tal:w tal:replace="round(sport_totals['max_distance'])"></tal:w>
                       <tal:t i18n:translate="">km</tal:t>
-                    </a>
+                    </tal:has-not-wid>
                   </li>
                   <li>
@@ -337,5 +365,15 @@
                       <tal:t i18n:translate="">Longer workout</tal:t>
                     </span>
-                    <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_time_wid']])">
+                    <tal:has-wid tal:condition="sport_totals['max_time_wid'] is not None">
+                      <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_time_wid']])">
+                        <tal:hms tal:define="hms timedelta_to_hms(sport_totals['max_time'])">
+                          <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h>
+                          <tal:t i18n:translate="">hours</tal:t>,
+                          <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h>
+                          <tal:t i18n:translate="">min.</tal:t>
+                        </tal:hms>
+                      </a>
+                    </tal:has-wid>
+                    <tal:has-not-wid tal:condition="sport_totals['max_time_wid'] is None">
                       <tal:hms tal:define="hms timedelta_to_hms(sport_totals['max_time'])">
                         <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h>
@@ -344,5 +382,5 @@
                         <tal:t i18n:translate="">min.</tal:t>
                       </tal:hms>
-                    </a>
+                    </tal:has-not-wid>
                   </li>
                   <li>
@@ -350,8 +388,14 @@
                       <tal:t i18n:translate="">Higher elevation gain</tal:t>
                     </span>
-                    <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_elevation_wid']])">
+                    <tal:has-wid tal:condition="sport_totals['max_elevation_wid'] is not None">
+                      <a href="" tal:attributes="href request.resource_url(context[sport_totals['max_elevation_wid']])">
+                        <tal:w tal:replace="round(sport_totals['max_elevation'])"></tal:w>
+                        <tal:t i18n:translate="">m</tal:t>
+                      </a>
+                    </tal:has-wid>
+                    <tal:has-not-wid tal:condition="sport_totals['max_elevation_wid'] is None">
                       <tal:w tal:replace="round(sport_totals['max_elevation'])"></tal:w>
                       <tal:t i18n:translate="">m</tal:t>
-                    </a>
+                    </tal:has-not-wid>
                   </li>
                 </ul>
