Improved handling of time periods.