minor fixes to TimePeriod class (constness, dry)