diff --git a/mod/quiz/db/install.xml b/mod/quiz/db/install.xml
index ececa20..b272e01 100755
--- a/mod/quiz/db/install.xml
+++ b/mod/quiz/db/install.xml
@@ -218,8 +218,8 @@
         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="quiz" NEXT="attempt"/>
         <FIELD NAME="attempt" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="sumgrades"/>
         <FIELD NAME="sumgrades" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="attempt" NEXT="timestart"/>
-        <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sumgrades" NEXT="timefinish"/>
-        <FIELD NAME="timefinish" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="timemodified"/>
+        <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sumgrades" NEXT="timefinish"/>
+        <FIELD NAME="timefinish" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timefinish" NEXT="layout"/>
         <FIELD NAME="layout" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="preview"/>
         <FIELD NAME="preview" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="layout"/>
diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php
index 0316715..98a11b8 100644
--- a/mod/quiz/report/overview/report.php
+++ b/mod/quiz/report/overview/report.php
@@ -486,7 +486,8 @@ class quiz_report extends quiz_default_report {
                         }
                         if ($attempt->timefinish) {
                             $timefinish = userdate($attempt->timefinish, $strtimeformat);
-                            $duration = format_time($attempt->duration);
+                            if ($attempt->duration < 0) $duration = '-';
+                            else $duration = format_time($attempt->duration);
                             if (!$download) {
                                 $row[] = '<a href="review.php?q='.$quiz->id.'&amp;attempt='.$attempt->attempt.'">'.$timefinish.'</a>';
                             } else {
diff --git a/mod/quiz/review.php b/mod/quiz/review.php
index bb24dad..c1dee92 100644
--- a/mod/quiz/review.php
+++ b/mod/quiz/review.php
@@ -174,7 +174,8 @@
     $overtime = 0;
 
     if ($attempt->timefinish) {
-        if ($timetaken = ($attempt->timefinish - $attempt->timestart)) {
+        if ($timetaken = ($attempt->timefinish - $attempt->timestart) &&
+            $attempt->timestart < $attempt->timefinish) {
             if($timelimit && $timetaken > ($timelimit + 60)) {
                 $overtime = $timetaken - $timelimit;
                 $overtime = format_time($overtime);
