Correctly process time-zones.
Clarified comment.
Improved how intervals are computed.