Fix bug in segment duration calculation.
Merge branch 'hotfix/0.6.1'