Fix counts of total-seconds, add tests