Fix calculations of time intervals
Merge pull request #70 from mlocati/fix-time-intervals

Fix calculations of time intervals