Fix time diff counting