Merge "Fix some bugs in duration tracker."