Fixed period computation bug.