fix bug in duration computation of Period